r - Getting a very basic aggregate to work -


i have been using ddply aggregating, it's way slow dataset have. (it takes several minutes.) aggregate work, i'm having trouble getting work @ basic level.

here's i'm trying:

v1 <- c("a", "a", "b", "b") v2 <- c(1:4) df <- data.frame(v1, v2, stringsasfactors = f)  agg <- aggregate(df, = list(v1), sum) 

here's error:

error in fun(x[[1l]], ...) : invalid 'type' (character) of argument   

i'm confused when use data frame first argument of aggregate , when use in data argument. also, ~ , . mean when used in first argument?


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -