Skip to content

Commit e21d651

Browse files
devpowerplatformDavisVaughan
authored andcommitted
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
1 parent 622afe8 commit e21d651

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vignettes/tidy-data.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ billboard3 %>% arrange(date, rank)
198198
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).
199199

200200
```{r}
201-
tb <- as_tibble(read.csv("tb.csv", stringsAsFactors = FALSE))
201+
tb <- readr::read_csv("https://raw.githubusercontent.com/tidyverse/tidyr/main/vignettes/tb.csv")
202202
tb
203203
```
204204

@@ -244,7 +244,7 @@ tb %>% pivot_longer(
244244
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.
245245

246246
```{r}
247-
weather <- as_tibble(read.csv("weather.csv", stringsAsFactors = FALSE))
247+
weather <- readr::read_csv("https://raw.githubusercontent.com/tidyverse/tidyr/main/vignettes/weather.csv")
248248
weather
249249
```
250250

0 commit comments

Comments
 (0)