[R] problems in converting numeric to character

2018-06-07 Thread
Hi, I am having trouble converting numeric to characters in the format I desire. To be more specific, I have a number of numeric as follows: x<-c(1.0,2.0,2.00,2.1) I want to convert them to characters so that the out put would be c(“1.0”,”2.0”,”2.00”,”2.1”). However, I used as.character(x) and

Re: [R] Converting a string to variable names

2017-11-15 Thread
> For (index in seq(1,16)){ > plot(x=(a given set of value),y=get(paste(“PC”,as.character(index),sep=“”))) > } > > On Wed, Nov 15, 2017 at 7:43 AM, 刘瑞阳 wrote: >> Hi, >> Suppose that I want to do a series of plots with the y value for each plot >> as PC1, PC2, PC3… How could

[R] Converting a string to variable names

2017-11-14 Thread
Hi, Suppose that I want to do a series of plots with the y value for each plot as PC1, PC2, PC3… How could I accomplish this using a for loop? Suppose the code like this: For (index in seq(1,16)){ plot(x=(a given set of value),y=paste(“PC”,as.character(index),sep=“”) } But this would not work be