diff --git a/data-tidy.Rmd b/data-tidy.Rmd index 2fe593a..9392522 100644 --- a/data-tidy.Rmd +++ b/data-tidy.Rmd @@ -325,7 +325,7 @@ An alternative to `names_sep` is `names_pattern`, which you can use to extract v ### Data and variable names in the column headers The next step up in complexity is when the column names include a mix of variable values and variable names. -For example, take the `family` dataset: +For example, take the `household` dataset: ```{r} family @@ -338,7 +338,7 @@ We again we need to supply a vector to `names_to` but this time we use the speci [^data-tidy-1]: Calling this `.value` instead of `.variable` seems confusing so I think we'll change it: ```{r} -family |> +household |> pivot_longer( cols = !family, names_to = c(".value", "child"), @@ -530,10 +530,6 @@ country_tb |> ggplot(aes(year, log10(count), group = country)) + geom_line() - - -country - library(gapminder) gapminder |> pivot_wider(