Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我猜 mlply 应该在这里用于相当于我在 mapply 中所做的事情,但我无法弄清楚如何。我真的很想更好地了解 plyr 包。
df <- data.frame(start=as.Date(c("2012-01-01","2012-02-02")),end=as.Date(c("2012-01-04","2012-02-08"))) l <- mapply(function(x,y) seq(x,y,by="day"),df$start, df$end)
提前致谢,--JT
如果您需要根据数据框中的变量名称来命名函数参数,我认为会有很大的不同:
mlply(df,function(start,end){seq(start,end,by = "day")})