Data functions in R

Adarsha Regmi
Mar 9, 2022


categorical data

Data types for 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


 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


that’s all for now. Keep learning.