The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

tenasakai (7) [Avatar] Offline
#1
I don't know what I am doing wrong, but when I type:

> patientdata$gender <- factor(patientdata$gender, levels = c(1,2), labels= c("male", "female"smilie)

I get:

Error in as.vector(x, mode) : invalid 'mode' argument

When/where did you introduce gender column for patientdata dataframe?
Help page for factor doesn't show it has parameter as.vector. I am confused.

Tena Sakai
robert.kabacoff (170) [Avatar] Offline
#2
Re: section 2.4.2 (Value labels)
Hi Tena,

The statement is not working because gender was left out of the dataset in the last edit. I will make the corrections. Sorry for the confusion.

Sincerely,

Rob