From 6ae3390dfc907a4480d1ff2d6e01364658f428f0 Mon Sep 17 00:00:00 2001 From: QuantScripter <95710662+devpowerplatform@users.noreply.github.com> Date: Sat, 20 Jul 2024 13:55:40 -0500 Subject: [PATCH] Update tidy-data.Rmd it is not easy to try out the two data sets (tb and weather). with this changes, any people can run the code to get the two data sets. Also use one of tidyverse packages to read in data sets --- vignettes/tidy-data.Rmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vignettes/tidy-data.Rmd b/vignettes/tidy-data.Rmd index c1fa65c9..e83d12a3 100644 --- a/vignettes/tidy-data.Rmd +++ b/vignettes/tidy-data.Rmd @@ -198,7 +198,7 @@ billboard3 %>% arrange(date, rank) After pivoting columns, the key column is sometimes a combination of multiple underlying variable names. This happens in the `tb` (tuberculosis) dataset, shown below. This dataset comes from the World Health Organisation, and records the counts of confirmed tuberculosis cases by `country`, `year`, and demographic group. The demographic groups are broken down by `sex` (m, f) and `age` (0-14, 15-25, 25-34, 35-44, 45-54, 55-64, unknown). ```{r} -tb <- as_tibble(read.csv("tb.csv", stringsAsFactors = FALSE)) +tb <- readr::read_csv("https://raw.githubusercontent.com/tidyverse/tidyr/main/vignettes/tb.csv") tb ``` @@ -244,7 +244,7 @@ tb %>% pivot_longer( The most complicated form of messy data occurs when variables are stored in both rows and columns. The code below loads daily weather data from the Global Historical Climatology Network for one weather station (MX17004) in Mexico for five months in 2010. ```{r} -weather <- as_tibble(read.csv("weather.csv", stringsAsFactors = FALSE)) +weather <- readr::read_csv("https://raw.githubusercontent.com/tidyverse/tidyr/main/vignettes/weather.csv") weather ```