vartype {lazy.tools} | R Documentation |
Find the mode/typeof of the columns of data
vartype(data, typeof = 0)
data |
a data frame to be checked. |
typeof |
= 1 to return typeof(var) instead of mode(var) |
mode -> "numeric", "character", etc
typeof -> "integer", "double", "character", etc
When data contains factors, "factor" will be returned for those varaibles.
a vector consisting of typeof or mode.
df=data.frame(a=1,b="a",c=as.factor(1), stringsAsFactors=0)
vartype(df)
vartype(df, typeof=1)
ls=list(a=1:2,b=2:4,c=c("a","b"),A=diag(2))
vartype(ls)
vartype(ls, typeof=1)