Displaying 1 result from an estimated 1 matches for "v1sum".
Did you mean:
x1sum
2014 Nov 21
1
dplyr/summarize does not create a true data frame
...ple(rep(heights, repcnt), rows, replace=T),
+ V1 = round(runif(rows)*25, 2) + 50,
+ V2 = round(runif(rows)*1000, 2) + 50,
+ V3 = round(runif(rows)*350, 2) - 175
+ )
>
> # use dplyr/summarize to create data frame
> my.output = frm %>%
+ group_by(Sex, Height) %>%
+ summarize(V1sum=sum(V1), V2sum=sum(V2))
> # work with columns in the output data frame
> ncol(my.output)
[1] 4
> my.output[1]
Source: local data frame [6 x 1]
Groups: Sex
Sex
1 Female
2 Female
3 Female
4 Male
5 Male
6 Male
> my.output[4]
Error in eval(expr, envir, enclos) : index out of...