Re: [R] Translation of the charter

2021-11-02 Thread Greg Minshall
hi, Heinz, > You are right - match seems obviously better, but why not do > > x <- c("a","b","c") > match(x, letters[]) no, really, i wasn't sure of the requirements! cheers, Greg __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see h

Re: [R] Translation of the charter

2021-11-02 Thread Heinz Tuechler
Greg, Greg Minshall wrote/hat geschrieben on/am 02.11.2021 08:57: Heinz, x <- c("a","b","c") lettersnum <- 1:length(letters[]) names(lettersnum) <- letters[] lettersnum[x] lettersnum[x] a b c 1 2 3 i'm not sure if the following is obviously better, but one might do b <- match(a, a) n

Re: [R] Translation of the charter

2021-11-02 Thread Greg Minshall
Heinz, > x <- c("a","b","c") > lettersnum <- 1:length(letters[]) > names(lettersnum) <- letters[] > lettersnum[x] > > lettersnum[x] > a b c > 1 2 3 i'm not sure if the following is obviously better, but one might do > b <- match(a, a) > names(b) <- a > b a b c 1 2 3 cheers, Greg _

Re: [R] Translation of the charter

2021-11-01 Thread Heinz Tuechler
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

Re: [R] Translation of the charter

2021-11-01 Thread Eric Berger
> R.oo::charToInt(x) # [1] 97 98 99 On Mon, Nov 1, 2021 at 9:48 PM Alice wrote: > > 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

[R] Translation of the charter

2021-11-01 Thread Alice
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]] __