Use of Level function in R


#1

Hi,
I was trying to extract the values in Categorical Variable Gender in R but it is returning null

Kindly help me out with this.


#2

@sanchi_singh1

Do one thing,You have to 1st convert the Gender to Factor.
data$Gender <- as.factor(data$Gender)
after that try
levels(data$Gender)

Check now, It will give you result


#3

Nope Still the same result

:frowning:


#4

you need to write this :
levels(data$Gender)


#5

Doneā€¦:slight_smile:
Thank You Hunaid