My Coding >
Software >
R >
R factors
R factorsFactors in R is a categorical variables (aka dummy variables). They can be used to keep unique categories from the vector. This can be considered as a analogy of structure set() from Python It is possible to make factors from any vecotor in R
To see the content of levels in factors it is possible to use all standard operations, as we use for vectors.
Base function to work with factors are:
The main interest in factor is the result if table() function, which give us named vector and we van use it as named vector
|
Last 10 artitles
9 popular artitles
|
|
© 2020 MyCoding.uk -My blog about coding and further learning. This blog was writen with pure Perl and front-end output was performed with TemplateToolkit. |