Displaying 3 results from an estimated 3 matches for "ruiyangliu94".
2017 Nov 15
2
Converting a string to variable names
...t 4:39 PM, Jim Lemon <drjimlemon at gmail.com> wrote:
>
> Hi Ruiyang,
> I think you want "get":
>
> 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, ??? <ruiyangliu94 at gmail.com> 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 I accomplish this using a for loop?
>> Suppose the code like this:
>>
>> For (index in seq(1,16)){
>> plot(x=(a given set of...
2017 Nov 14
0
Converting a string to variable names
Hi Ruiyang,
I think you want "get":
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, ??? <ruiyangliu94 at gmail.com> 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 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.ch...
2017 Nov 14
2
Converting a string to variable names
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 because y is assigned a string instead of the variable names. So how could I assign y with a variable