Some of the help/man files have roxygen2 examples that convert data as originally given in 538's GitHub to "tidy" format using tidyr::gather(). However, tidyr now includes much more intuitively-named and easier to use functions pivot_longer() and pivot_wider(). See this tidyverse.org blog post for more information.
In the case of fivethirtyeight package, we should replace all gather() code with pivot_longer(). For example, if you run ?drinks you'll currently see in the examples:
A search of gather in all R/data_X.R files will locate the roxygen2 code for all such cases. For example, the roxygen2 code for drinks is in data_albert.R.
@beanumber Let me know if you have someone who can do this, and I'll explicitly make them an assignee.
Some of the help/man files have
roxygen2
examples that convert data as originally given in 538's GitHub to "tidy" format usingtidyr::gather()
. However,tidyr
now includes much more intuitively-named and easier to use functionspivot_longer()
andpivot_wider()
. See this tidyverse.org blog post for more information.In the case of
fivethirtyeight
package, we should replace allgather()
code withpivot_longer()
. For example, if you run?drinks
you'll currently see in the examples:This needs to be updated with:
A search of
gather
in allR/data_X.R
files will locate theroxygen2
code for all such cases. For example, theroxygen2
code fordrinks
is indata_albert.R
.@beanumber Let me know if you have someone who can do this, and I'll explicitly make them an assignee.