Hello,

Inline.

Em 20-11-2016 20:40, Rolf Turner escreveu:
On 21/11/16 09:03, Rui Barradas wrote:
Hello,

I know nothing about the plsr package but in the data.frame 'gasoline'
the column NIR is numeric and in 'lid_allt2' the column lid_nose is
character. Maybe you need

lid_allt2$lid_nose <- as.numeric(lid_allt2$lid_nose)

but I really don't know if this is the problem.


I have no idea either, but surely your suggestion should be:

lid_allt2$lid_nose <- as.numeric(as.character(lid_allt2$lid_nose))

Actually no, I also thought of that but str(lid_allt2) doesn't say that lid_nose is a factor, it says "chr".

Rui Barradas


or (better):

lid_allt2$lid_nose <-
     with(lid_allt2,as.numeric(levels(lid_nose))[lid.nose])


cheers,

Rolf


______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to