dplyr

    4热度

    2回答

    我已经玩了dplyr一点,真的很喜欢它。我虽然失去了一些东西。在plyr中,我能够将一个函数传递给ddply并重用它。 library('dplyr') library('plyr') fn = function(df) { summarise(df, count = length(id)) } ddply(DF1,'group', fn) ddply(DF2,

    3热度

    1回答

    可以执行链接summarise操作data.frame? 我data.frame具有结构: data_df = tbl_df(data) data_df %.% group_by(col_1) %.% summarise(number_of= length(col_2)) %.% summarise(sum_of = sum(col_3)) 这将导致RS

    18热度

    5回答

    如果我不知道列名,但是想通过变量指定它,如何将列名传递给dplyr? 例如这个工程: require(dplyr) df <- as.data.frame(matrix(seq(1:9),ncol=3,nrow=3)) df$group <- c("A","B","A") gdf <- df %.% group_by(group) %.% summarise(m1 =mean(V1),m2

    5热度

    1回答

    我想这是一个dplyr比plyr更多的问题。为了提高速度,我在我写的一些代码中使用了data.table。期间的中间步骤我有一些基因组学与数据的表〜32,000行: > bedbin.dt Source: local data table [32,138 x 4] Groups: chr bin start site chr 1 2 3500000 ssCTCF 1 2

    15热度

    6回答

    (通过对象关系映射,我的意思是这里描述:Wikipedia: Object-relational mapping) 这里是我能想象在读该工作:一种“虚拟数据帧”是链接到数据库,并返回访问时SQL查询的结果。例如,head(virtual_list)实际上会在映射的数据库上返回(select * from mapped_table limit 5)的结果。 我发现这post by John Myle