Re: [R] Assigning Data a name from within another variable?

2009-06-16 Thread Kenny Larsen
Thnaks to both of you, with a combined effort of the Wiki and your code I have now managed to get teh result I was after. When I have a better understanding of what the code is doing I shall make an effort to contribut to the Wiki! Cheers, Kenny Kenny Larsen wrote: Hi All, I have

[R] Assigning Data a name from within another variable?

2009-06-15 Thread Kenny Larsen
Hi All, I have hunted high and low and tried dozens of things but have yet to achieve the result I require. Below is my code (taken mostly from another thread on here) thus far: files-list.files() files-files[grep('.wm4', files)] labels-gsub('.wm4', '',files) for(i in 1:length(files)){

Re: [R] Assigning Data a name from within another variable?

2009-06-15 Thread jim holtman
Use a 'list' to read in the data and access it: files-list.files() files-files[grep('.wm4', files)] labels-gsub('.wm4', '',files) myInput - lapply(files, read.table) # if you want to get rid of .wm4 names(myInput) - sub(.wm4$, , names(myInput)) On Mon, Jun 15, 2009 at 11:50 AM, Kenny Larsen

Re: [R] Assigning Data a name from within another variable?

2009-06-15 Thread baptiste auguie
Kenny Larsen wrote: Hi All, I have hunted high and low and tried dozens of things but have yet to achieve the result I require. Below is my code (taken mostly from another thread on here) thus far: files-list.files() files-files[grep('.wm4', files)] labels-gsub('.wm4', '',files) for(i in