Displaying 1 result from an estimated 1 matches for "repcnt".
Did you mean:
refcnt
2014 Nov 21
1
dplyr/summarize does not create a true data frame
...summarize. The ncol() function says that my.output has 4 columns, but "my.output[4]" fails. Note that converting my.output using as.data.frame() makes for a happy ending.
Is this the intended behavior of dplyr?
Tx,
John
> library(dplyr)
> # set up data frame
> rows = 100
> repcnt = 50
> sexes = c("Female", "Male")
> heights = c("Med", "Short", "Tall")
> frm = data.frame(
+ Id = paste("P", sprintf("%04d", 1:rows), sep=""),
+ Sex = sample(rep(sexes, repcnt), rows, replace=T),
+ Hei...