Re: [R] sum on column using apply

2010-04-25 Thread David Winsemius
On Apr 25, 2010, at 11:30 PM, robert lee wrote: Wanted to thank David and Jim for the str. The x and y were created using the function below. In one case, reshape1 returned list and other data frame. I put the fix by putting the as.data.frame below I hope you are making progress on

Re: [R] sum on column using apply

2010-04-25 Thread robert lee
Wanted to thank David and Jim for the str. The x and y were created using the function below. In one case, reshape1 returned list and other data frame. I put the fix by putting the as.data.frame below myPivot <- function(y,x,z,m, ...){ m1 <- m[c(x,y,z)] # select the the columns wanted

Re: [R] sum on column using apply

2010-04-25 Thread David Winsemius
On Apr 25, 2010, at 10:15 PM, robert lee wrote: I have two data frames ( x and y -- sample values below). The rows have HH:MM:SS and columns have names of devices. I am trying to find a list of 5 least used devices during recorded time period. When apply function is used to sum on the co

[R] sum on column using apply

2010-04-25 Thread robert lee
I have two data frames ( x and y -- sample values below). The rows have HH:MM:SS and columns have names of devices. I am trying to find a list of 5 least used devices during recorded time period. When apply function is used to sum on the column, I get the correct answer on data frame called x