Re: [R] SAPPLY function XXXX

2011-05-04 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 04.05.2011 22:26:59: > Erik Iverson > Odeslal: r-help-boun...@r-project.org > > 04.05.2011 22:26 > > Komu > > Dan Abner > > > > Ultimately, I would like for this to be 1 conponent in a larger function > > that will produce PROC CONTENTS style ou

Re: [R] SAPPLY function XXXX

2011-05-04 Thread Dan Abner
Perfect Erik! Thank you! On Wed, May 4, 2011 at 4:22 PM, Erik Iverson wrote: > Dan, > > > > I am attempting to write a function to count the number of non-missing >> values of each column in a data frame using the sapply function. I have >> the >> following code which is receiving the error me

Re: [R] SAPPLY function XXXX

2011-05-04 Thread Erik Iverson
Ultimately, I would like for this to be 1 conponent in a larger function that will produce PROC CONTENTS style output. Something like... data1.contents<-data.frame(Variable=names(data1), Class=sapply(data1,class), n.valid=sapply(data1,sum(!is.na)), n.miss=sapply(data1,sum(is.na))) data1.cont

Re: [R] SAPPLY function XXXX

2011-05-04 Thread Erik Iverson
Dan, I am attempting to write a function to count the number of non-missing values of each column in a data frame using the sapply function. I have the following code which is receiving the error message below. n.valid<-sapply(data1,sum(!is.na)) Error in !is.na : invalid argument type Tha

[R] SAPPLY function XXXX

2011-05-04 Thread Dan Abner
Hello everyone, I am attempting to write a function to count the number of non-missing values of each column in a data frame using the sapply function. I have the following code which is receiving the error message below. > n.valid<-sapply(data1,sum(!is.na)) Error in !is.na : invalid argument ty