factor:
Numerical counterpart of character value is called factor
The factor function is used to create a factor.
The only required argument to factor is a vector of values which will be returned as a vector of factor values..
Numerical counterpart of character value is called factor
The factor function is used to create a factor.
The only required argument to factor is a vector of values which will be returned as a vector of factor values..
#factor:numerical counterpart of character value is called factor
journey_type<-c("train","bus","flight","bus","flight","train")
journey_type
journey_typefact<-as.factor(journey_type)
journey_typefact
class(journey_typefact)
as.integer(journey_typefact)
journey_type
journey_typefact<-as.factor(journey_type)
journey_typefact
class(journey_typefact)
as.integer(journey_typefact)
#as.integer is displaying how our values as 1,2 and 3 are
#bus is 1, flight is 2 and train is 3 as due to alphabetic order as b come first so 1 and so on..
#bus is 1, flight is 2 and train is 3 as due to alphabetic order as b come first so 1 and so on..
You don't realize how quickly technology is changing. Data science is highly technical and is therefore in high demand. A career in data science will open up many lucrative job opportunities. So, if you have been wanting to start your career in Data Science, now is the best time to enroll in a data science program with one of the best data science training institute in noida.
ReplyDelete