¿Por qué este dplyr dput no funciona?
Tengo un marco de datos obtenido usando la siguiente secuencia de operaciones de tubería:
library(dplyr)
data_agg = data %>%
group_by(Year,Month) %>%
summarise( monthly_users = sum(Users))
head(data_agg)
Se ve como esto:
Year Month monthly_users
1 2013 07 22
2 2013 08 221
3 2013 09 252
4 2013 10 313
5 2013 11 322
6 2013 12 339
yo ahoradput()
obteniendo:
structure(list(Year = c("2013", "2013", "2013", "2013", "2013",
"2013", "2014", "2014", "2014", "2014", "2014", "2014", "2014"
), Month = c("07", "08", "09", "10", "11", "12", "01", "02",
"03", "04", "05", "06", "07"), monthly_users = c(22L, 221L, 252L,
313L, 322L, 339L, 344L, 338L, 301L, 307L, 401L, 383L, 318L)), .Names = c("Year",
"Month", "monthly_users"), row.names = c(NA, -13L), class = c("grouped_df",
"tbl_df", "tbl", "data.frame"), vars = list(Year), drop = TRUE)
Sin embargo, cuando ejecuto la salida anterior dedput()
Obtuve el siguiente error:
Error in structure(list(Year = c("2013", "2013", "2013", "2013", "2013", :
objeto 'Año' no encontrado
¿Por qué está pasando esto?