Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Data:
- df1 <- as.Date(c('Jul 1', 'Jun 26', 'July 5', 'July 15'), format = '%B %d')
- df2 <- c("red", "blue", "red", "blue")
- df1 <- data.frame(df1,df2)
- # Group.1 x
- [1] 4 red
- [2] 19 blue
- df <- aggregate(df1[,1], list(df1[,2]), as.numeric(max(df1[,1]) - min(df1[,1]), units="days"))
- Error in match.fun(FUN) :
- 'as.numeric(max(df1$date) - min(df1$date), units = "days")' is not a function, character or symbol
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement