Thankyou for the replies.
assign() works.
for (i in 1:7)
assign(filesBox[i,1],read.table(paste(dir2, filesBox[i,1], sep=""), header =
FALSE))
--
View this message in context:
http://www.nabble.com/using-an-element-of-an-array-as-a-new-object-tp14884435p14917349.html
Sent from the R help mail
o: r-help@r-project.org
> Subject: [R] using an element of an array as a new object
>
>
> I have an array called filesBox. I want to take each element
> of the first column and assign a dataset to it.
>
> For example :
>
> filesBox[4,1] returns
>
> [1] &qu
See ?assign.
ppaarrkk wrote:
> I have an array called filesBox. I want to take each element of the first
> column and assign a dataset to it.
>
> For example :
>
> filesBox[4,1] returns
>
> [1] "fileR"
>
> Then I want to assign "fileR" which exists as a text file to the R object
> "fileR" lik
I have an array called filesBox. I want to take each element of the first
column and assign a dataset to it.
For example :
filesBox[4,1] returns
[1] "fileR"
Then I want to assign "fileR" which exists as a text file to the R object
"fileR" like this :
filesBox[4,1] <- read.table(paste(dir2, fi
4 matches
Mail list logo