But be careful because class is a character vector (not necessarily a
character vector of length 1)
On Fri, Dec 30, 2011 at 10:21 AM, Justin Haynes wrote:
> there is also colwise in the plyr package.
>
>> library(plyr)
>> colwise(class)(data6)
> v13 v14 v15 f4 v16
> 1 integ
there is also colwise in the plyr package.
> library(plyr)
> colwise(class)(data6)
v13 v14 v15 f4 v16
1 integer numeric character factor logical
Justin
On Thu, Dec 29, 2011 at 4:47 PM, Jean V Adams wrote:
> Dan Abner wrote on 12/29/2011 06:13:11 PM:
>
> > Hi everyone,
Dan Abner wrote on 12/29/2011 06:13:11 PM:
> Hi everyone,
>
> I am attempting to use the apply() function to obtain the mode and class
of
> each column in a data frame, however, I am encountering unexpected
results.
> I have the following example data:
>
>
> v13<-1:6
> v14<-c(1,2,3,3,NA,1)
>
Hi Dan: The reason that happens is because apply expects a matrix as input
so, since you sent in a dataframe ( which is really a list with each
component the same length ), apply converts the input dataframe to a matrix
but, when doing this, it needs to make conversions because a matrix needs
to be
Hi everyone,
I am attempting to use the apply() function to obtain the mode and class of
each column in a data frame, however, I am encountering unexpected results.
I have the following example data:
v13<-1:6
v14<-c(1,2,3,3,NA,1)
v15<-c("Good","Bad",NA,"Good","Bad","Bad")
f4<-factor(rep(c("Blue"
5 matches
Mail list logo