Data functions in R
Mar 9, 2022
categorical data
Some useful methods in R that helps while working with the similar type of data
a) factor
multiple values are considered as categories and neglicted duplicate values
eg;
survey_vector <- c(“M”, “F”, “F”, “M”, “M”)factor_survey_vector <- factor(survey_vector)
b) levels
placing label for the categories
levels(factor_survey_vector) <-c("Female","Male")factor_survey_vector
c) summary
similar to the way there exist summary method in pandas in python here we’ve summary method
summary(my_var)
that’s all for now. Keep learning.