View(EG17_06MOVPROF)
View(EG17_06MOVPROF)
EG17_06MOVPROF[, 'Title'] <- as.factor(EG17_06MOVPROF[, 'Title'])
EG17_06MOVPROF
str(EG17_06MOVPROF)
indx <- sapply(EG17_06MOVPROF, is.factor)
indx
EG17_06MOVPROF[indx] <- lapply(EG17_06MOVPROF[indx], function(x) as.numeric(as.character(x)))
View(EG17_06MOVPROF)
View(EG17_06MOVPROF)
EG17_06MOVPROF[, 'Title'] <- as.factor(EG17_06MOVPROF[, 'Title'])
View(EG17_06MOVPROF)
EG17_06MOVPROF
EG17_06MOVPROF[, 'Title'] <- as.numeric(as.character(EG17_06MOVPROF[, 'Title']))
View(EG17_06MOVPROF)
as.numeric.factor <- function(x) {as.numeric(levels(x))[x]}
EG17_06MOVPROF[, 'Title'] <-as.numeric.factor(EG17_06MOVPROF[, 'Title'])
View(EG17_06MOVPROF)
load("/Developer/Projects/_BFW/Statistics Datasets/PSBE4e/R/CH17/EG17-06MOVPROF.rda")
View(EG17_06MOVPROF)
EG17_06MOVPROF[, 'Title'] <-as.numeric.factor(EG17_06MOVPROF[, 'Title'])
as.numeric.factor <- function(x) {as.numeric(levels(x))[x]}
EG17_06MOVPROF[, 'Title'] <- as.numeric.factor(EG17_06MOVPROF[, 'Title'])
View(EG17_06MOVPROF)
as.factor(EG17_06MOVPROF[, 'Title'])
View(EG17_06MOVPROF)
load("/Developer/Projects/_BFW/Statistics Datasets/PSBE4e/R/CH17/EG17-06MOVPROF.rda")
View(EG17_06MOVPROF)
View(EG17_06MOVPROF)
as.factor(EG17_06MOVPROF[, 'Title'])
as.factor(EG17_06MOVPROF[, 'Genre'])
as.factor(EG17_06MOVPROF[, 'Genre']).Levels
as.factor(EG17_06MOVPROF[, 'Genre'],Levels)
levels(as.factor(EG17_06MOVPROF[, 'Genre']))
as.numeric(levels(as.factor(EG17_06MOVPROF[, 'Genre'])))
levels(as.factor(EG17_06MOVPROF[, 'Genre']))
as.numeric(levels(as.factor(EG17_06MOVPROF[, 'Genre'])))
f<-as.factor(EG17_06MOVPROF[, 'Genre'])
as.numeric(levels(f))[f]
(levels(f))[f]
as.numeric((levels(f)[f])
)
f<-as.factor(EG17_06MOVPROF[, 'Genre'])
as.integer(f)
as.integer(as.factor(EG17_06MOVPROF[, 'Genre']))
EG17_06MOVPROF[, 'Genre']<-as.integer(as.factor(EG17_06MOVPROF[, 'Genre']))
View(EG17_06MOVPROF)
View(EG17_06MOVPROF)
EG17_06MOVPROF[, 'Genre']<-as.integer(as.factor(EG17_06MOVPROF[, 'Genre']))
View(EG17_06MOVPROF)
View(EG17_06MOVPROF)
EG17_06MOVPROF
as.integer(as.factor(EG17_06MOVPROF[, 'Genre']))
EG17_06MOVPROF[, 'Rating']<-as.integer(as.factor(EG17_06MOVPROF[, 'Rating']))
EG17_06MOVPROF
View(EG17_06MOVPROF)
