r2lFindClasses {r2lUniv} | R Documentation |
r2lFindClasses
sets the basic type of each column in a data.frame
.
r2lFindClasses(dataFrame, limDiscrete = 10)
dataFrame |
dataFrame whose type is to be set. |
limDiscrete |
numeric ; fixes the limit that distinguishes continuous variables
from discrete ones. See r2lFindClass for details. |
r2lFindClasses
is a generalisation of r2lFindClass.
It calls r2lFindClass
on each column of the data.frame
.
The return value is a four-fields list - one for each basic
type-. Each field contains the columns that have the corresponding
basic type.
A four-fields list:
Nominal |
column numbers found to be nominal |
Ordinal |
column numbers found to be ordinal |
Discrete |
column numbers found to be discrete |
Continuous |
column numbers found to be continuous |
Christophe Genolini christophe.genolini@free.fr
r2lUniv
,
r2lUniv.data.frame
,
r2lFindClasses
,
r2lModifyClasses
# # # # # # # # # # # # # # # # # # # # R to LaTeX, Univariate Analyses # # Examples # # r2lFindClasses # # # # # # # # # # # # # # # # # # data(examCheating) ### Without modification in examCheating r2lFindClasses(examCheating) ### With modifications examCheating$Id <- factor(examCheating$Id) examCheating$YearOfStudy <- ordered(examCheating$YearOfStudy,levels=c("L1","L2","L3","M1","M2")) examCheating$Bac <- ordered(examCheating$Bac,levels=c("Remedial exam","Pass","Fairly good","Good","Very good","Summa cum laude")) for(iColumn in 8:17){examCheating[,iColumn] <- ordered(examCheating[,iColumn],levels=c("Never","Rarely","Sometimes","Often","Always"))} str(examCheating) r2lFindClasses(examCheating) r2lFindClasses(examCheating,3) ### Special case: only one class r2lFindClasses(examCheating[,8:12])