You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm one of your students and love your work. I am trying to convince people on my team to move away from Excel and love the idea of porting Excel Functions to R to get people going. However, pivot_table seems to throw an error that rows don't exist if they are raw rows> 1.
Hi Matt,
I'm one of your students and love your work. I am trying to convince people on my team to move away from Excel and love the idea of porting Excel Functions to R to get people going. However, pivot_table seems to throw an error that rows don't exist if they are raw rows> 1.
From your example,
`
library(tidyquant)
library(tidyverse)
library(lubridate)
this works
FANG %>%
pivot_table(
.rows = c(symbol, ~ QUARTER(date)),
.columns = ~ YEAR(date),
.values = ~ PCT_CHANGE_FIRSTLAST(adjusted)
)
this does as well....
FANG %>%
pivot_table(
.rows = c(symbol, ~ymd(date)),
.columns = ~ YEAR(date),
.values = ~ PCT_CHANGE_FIRSTLAST(adjusted)
)
this doesn't. Do row arguments > 2 need a function to work?
FANG %>%
pivot_table(
.rows = c(symbol, date),
.columns = ~ YEAR(date),
.values = ~ PCT_CHANGE_FIRSTLAST(adjusted)
)
`
The text was updated successfully, but these errors were encountered: