Alice wrote/hat geschrieben on/am 31.10.2021 07:33:
Dear members,

How to translate the charter to the underline inter?
I tried this:

x <- c("a","b","c")

as.numeric(x)

[1] NA NA NA

Warning message:

NAs introduced by coercion


It didn't work.

Sorry for my newbie questions.


B.R.

Alice

        [[alternative HTML version deleted]]

______________________________________________
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.

Is this, what you are looking for:

x <- c("a","b","c")
lettersnum <- 1:length(letters[])
names(lettersnum) <- letters[]
lettersnum[x]
> lettersnum[x]
a b c
1 2 3

best,
Heinz

______________________________________________
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