Re: [R] tidyr gather(function)

2019-07-16 Thread Eric Berger
tempDat.long <- gather(data=tempDat, key=month, value=temp, "Jan", "Feb","Mar", "Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec") %>% dplyr::mutate( monthIndex=match(month,month.abb)) %>% dplyr::arrange( Year, monthIndex) %>%

Re: [R] tidyr gather(function)

2019-07-15 Thread Patrick (Malone Quantitative)
What happens if you use key=year? Also, tables get mangled when you post in HTML to plain-text list. On Mon, Jul 15, 2019 at 6:47 PM wrote: > > r-help > > > > Needing to transform some data for a time series (1930 - 2018). > > > > > tempDat > # A tibble: 89 x 13 > Year Jan Feb Mar A

[R] tidyr gather(function)

2019-07-15 Thread reichmanj
r-help Needing to transform some data for a time series (1930 - 2018). > tempDat # A tibble: 89 x 13 Year Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec 1 1930 5260.3 60.6 72.2 71.7 86.8 91.3 89.7 82.3 70.4 60.2 52.2 2 1931 52.9