% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pgm.R
\name{vartype}
\alias{vartype}
\title{Find the mode/typeof of the columns of data}
\usage{
vartype(data, typeof = 0)
}
\arguments{
\item{data}{a data frame to be checked.}

\item{typeof}{= 1 to return typeof(var) instead of mode(var)}
}
\value{
a vector consisting of typeof or mode.
}
\description{
Find the mode/typeof of the columns of data
}
\details{
mode   -> "numeric", "character", etc \cr
   typeof -> "integer", "double", "character", etc \cr\cr
When data contains factors, "factor" will be returned for those varaibles.
}
\examples{
 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)

}
