R: [R] Problem with a matrix

Uwe Ligges ligges at statistik.uni-dortmund.de
Sun Apr 21 21:07:33 CEST 2002


Ambrosini Alessandro wrote:
> 
> Thank you very much. Everything is ok.
> I make you another question (and I hope that it will be the last one).
> If names of nodes are not "a", "b", "c" but "Italy", "Spain", "England" how
> can I change the command
> 
>  x <- lapply(x,match,letters) to obtain the usual matrix?
> If I write the command in this way, the output is NA NA NA ... and so maybe
> I have to change "letters". What have I to write?
> Thank you and excuse me for the disturb.

Instead of the
 letters
[1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q"
"r" "s" "t" "u" "v" "w" "x" "y" "z"
you might want to define and use a variable
 countries <- c("Italy", "Spain", "England")

Uwe Ligges
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list