Read R4DS chapter 12.
Solve the chapters Tidy Data and From Wide to Long and Back of the Reshaping Data with tidyr course at DataCamp.
class_files/Statistikdatabasen_2019-11-14 23_25_40.csv
contains records of adults visiting dental care by sex, municipality and
year (downloaded from The National Board of
Health and Welfare dental health records). Read it withdental_data <- read_csv2("class_files/Statistikdatabasen_2019-11-14 23_25_40.csv", skip = 1, n_max = 580)
(why skip = 1
and n_max = 580
?) and use
pivot_longer
to convert it to long (“tidy”) format.
class_files/Statistikdatabasen_2018-01-23 15_04_12.csv
contains records of suicides and death totals by sex, county and year
(from The
National Board of Health and Welfare). Read it withdata <- read_csv2("class_files/Statistikdatabasen_2018-01-23 15_04_12.csv", skip = 1, n_max = 80)
and plot the proportion of suicides among death totals, by year, for the whole country.
The file class_files/Statistikdatabasen_2018-01-23 15_39_06.csv
contains monthly records of social assistance (ekonomiskt bistånd).
Explore it in a spread sheet and transform to “tidy format” containing
the variable average payment per houshold
(Utbetalt ekonomiskt bistånd tkr
divided by
Antal hushåll
) for each month and county. It may be helpful
to join the first two columns using paste
.
Examination of the course Matematik I (MM2001) consists a large
number of smaller labs/exams with individual codes (Provkoder), see the
course plan
for a full list. The file class_files/MM2001.csv
contains results for 100 randomly chosen students exported using and
older version of Ladok. Each row
corresponds to one student (name and id removed). Transform data (or a
subset of data) to a tidy format.