how to avoid change string to number automaticlly in r

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how to avoid change string to number automaticlly in r

the_simpsons
I was trying to save some string into a matrix, but it automatically
changed to numbers (levels). How can i avoid it??

Here is the original table:

  trt    means  M1 0   12.16673  a2 111 11.86369 ab3 125 11.74433 ab4
14  11.54073  b

I wanna to save to a matrix like:
J0001 a ab ab b

But, what i get is:
J0001 1 2 2 3

How can i avoid this?

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|

Re: how to avoid change string to number automaticlly in r

arun kirshna
A similar post was found in stackoverflow (http://stackoverflow.com/questions/25328311/how-to-avoid-change-string-to-number-automaticlly-in-r), which already got an accepted reply.

A.K.




On Friday, August 15, 2014 2:18 PM, Wenlan Tian <[hidden email]> wrote:
I was trying to save some string into a matrix, but it automatically
changed to numbers (levels). How can i avoid it??

Here is the original table:

  trt    means  M1 0   12.16673  a2 111 11.86369 ab3 125 11.74433 ab4
14  11.54073  b

I wanna to save to a matrix like:
J0001 a ab ab b

But, what i get is:
J0001 1 2 2 3

How can i avoid this?

    [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.


______________________________________________
[hidden email] 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.