I wanted to view the transformed dataframe using the flights dataset but R shows an invalid caption argument error
library(dplyr)
library(nycflights13)
view (temp <- flights %>%
group_by(year, month, day) %>%
mutate(r = min_rank(desc(dep_time))) %>%
filter(r %in% range(r)))
Error in View : invalid caption argument
However, this one with the piping operator works fine.
(temp <- flights %>%
group_by(year, month, day) %>%
mutate(r = min_rank(desc(dep_time))) %>%
filter(r %in% range(r))) %>% view()
So does this one (with a capital V)
View (temp <- flights %>%
group_by(year, month, day) %>%
mutate(r = min_rank(desc(dep_time))) %>%
filter(r %in% range(r)))
Even this one (where the transformed dataframe is not assigned to an object works)
view (flights %>%
group_by(year, month, day) %>%
mutate(r = min_rank(desc(dep_time))) %>%
filter(r %in% range(r)))
Could anyone explain what's happening and why the error in the first case and not the other three? Thank you in advance.