-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdata_cleaning.R
More file actions
66 lines (66 loc) 路 2.01 KB
/
Copy pathdata_cleaning.R
File metadata and controls
66 lines (66 loc) 路 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# library(dplyr)
# library(stringr)
# library(tidyr)
#
#
# burger_king_menu <- read.csv("data/burger-king-menu.csv")
# deaths_obesity <- read.csv("data/deaths-due-to-obesity.csv")
# quick_service_restaurants_us <- read.csv("data/number-of-quick-service-restaurants-in-the-us-2011_2022.csv")
# Nutrition_Value_Dataset <- read.csv("data/Nutrition_Value_Dataset.csv")
# obesity <- read.csv("data/obesity-cleaned.csv")
#
# df <- deaths_obesity %>%
# filter(Entity == "United States")
#
# plot(df$Year, df$Deaths.that.are.from.all.causes.attributed.to.high.body.mass.index..in.both.sexes.aged.all.ages)
#
# ee <- deaths_obesity %>%
# mutate(Deaths = round(Deaths))
#
# eee <- obesity %>%
# select(!X)
#
# write.csv(eee, file = "data/obesity-cleaned.csv",row.names = FALSE)
#
# obesity %>%
# separate_longer_delim(Obesity...., delim = " ")
#
# # Przyk艂adowy napis
# napis <- "0.5 [0.2-1.1]"
#
# # U偶yj funkcji strsplit do podzia艂u napisu na cz臋艣ci
# czesci <- strsplit(napis, " ")
#
# # Wydziel pierwsz膮 cz臋艣膰
# pierwsza_czesc <- czesci[[1]][1]
#
# # Wy艣wietl wynik
# print(pierwsza_czesc)
#
# strsplit(obesity$Obesity...., " ")
#
# obesity <- obesity %>%
# mutate(Obesity.... = str_extract(Obesity...., "\\d+\\.\\d+"),
# obesity_percent = as.numeric(Obesity....))
#
# www <- obesity %>%
# select(!Obesity....) %>%
# mutate(Obesity_percent = obesity_percent) %>%
# select(!obesity_percent)
#
# write.csv(www, file = "data/obesity-cleaned.csv",row.names = FALSE)
#
# us_population <- read.csv("data/population_usafacts.csv")
#
# us_population %>%
# filter(Years == "Population (People)") %>%
# select(-c(X1900,X1901,X1902,X1903,X1904,X1905,X1906,X1907)) %>%
# pivot_longer(cols = -Years, names_to = "Year", values_to = "Population") %>%
# mutate(Year = as.integer(str_remove(Year, "X"))) %>%
# select(Year, Population) %>%
# write.csv(file = "data/population_usa.csv", row.names = FALSE)
#
#
#
#
#