Hi,

The first column in as.matrix(x) has extra spaces (" "), which I don't
want. Is there a way not to generate those spaces?

Regards,
Peng

> x=data.frame(x=1:10,y=letters[11:20])
> as.matrix(x)
      x    y
 [1,] " 1" "k"
 [2,] " 2" "l"
 [3,] " 3" "m"
 [4,] " 4" "n"
 [5,] " 5" "o"
 [6,] " 6" "p"
 [7,] " 7" "q"
 [8,] " 8" "r"
 [9,] " 9" "s"
[10,] "10" "t"

______________________________________________
R-help@r-project.org mailing list
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