Closed ADernild closed 4 years ago
Thanks so much for looking at this @ADernild! Can you tell me a little more about the error you are seeing? I don't believe there is a problem with using :
. I have the most up-to-date version of tidyr and I don't have any problems with running this.
library(tidyverse)
relig_income %>%
select(-`Don't know/refused`) %>%
gather(income, count, `<$10k`:`>150k`)
#> # A tibble: 162 x 3
#> religion income count
#> <chr> <chr> <dbl>
#> 1 Agnostic <$10k 27
#> 2 Atheist <$10k 12
#> 3 Buddhist <$10k 27
#> 4 Catholic <$10k 418
#> 5 Don’t know/refused <$10k 15
#> 6 Evangelical Prot <$10k 575
#> 7 Hindu <$10k 1
#> 8 Historically Black Prot <$10k 228
#> 9 Jehovah's Witness <$10k 20
#> 10 Jewish <$10k 19
#> # … with 152 more rows
Created on 2020-10-12 by the reprex package (v0.3.0.9001)
What I should do is update everything to pivot_longer()
/pivot_wider()
; they are much easier to use IMO.
Let us know if you have further questions @ADernild!
The gather() function doesn't work properly when using a colon, resulting in an error when trying to plot.