Re: [R] Sprintf to call data frame from environment

2016-05-24 Thread Jim Lemon
Hi Beatriz, I'll guess that you have a number of files with names like this: Samples_1.txt Samples_2.txt ... Each one can be read with a function like read.table and will return a data frame with default names (V1, V2, ...). You then want to extract the first element (column) of the data frame.

Re: [R] Sprintf to call data frame from environment

2016-05-24 Thread David Winsemius
> On May 24, 2016, at 2:01 PM, Beatriz wrote: > > > In my environment I have a data frame called Samples_1.txt. > From this data frame I need to get variable V1. My code doesn't work. Thanks! > > $V1 > > Note: I need to do it in this way because I have the

Re: [R] Sprintf to call data frame from environment

2016-05-24 Thread Nordlund, Dan (DSHS/RDA)
y 24, 2016 2:01 PM > To: r-help@r-project.org > Subject: [R] Sprintf to call data frame from environment > > > In my environment I have a data frame called Samples_1.txt. > From this data frame I need to get variable V1. My code doesn't work. > Thanks! > >

[R] Sprintf to call data frame from environment

2016-05-24 Thread Beatriz
In my environment I have a data frame called Samples_1.txt. From this data frame I need to get variable V1. My code doesn't work. Thanks! sprintf("Samples_%s.txt", 1)$V1 Note: I need to do it in this way because I have the code into a for loop.

[R] Sprintf to call data frame from environment

2016-05-24 Thread Beatriz
In my environment I have a data frame called Samples_1.txt. From this data frame I need to get variable V1. My code doesn't work. Note: I need to do it in this way because I have the code into a for loop. sprintf("Samples_%s.txt", 1)$V1 __