Re: [R] Data Manipulation

2010-01-26 Thread Peter Rote
I still struggling with this: error massage: by(AlexETF,AlexETF$Industry,function(a) {filename = paste(C:/ab/,gsub( ,,a$Industry[1]),.txt,sep=) + print(filename) + write.table(a[,3,drop=FALSE],quote=FALSE,col.names=FALSE,row.names=FALSE) + } + ) [1]

Re: [R] Data Manipulation

2010-01-22 Thread Peter Rote
Thank you Don for the code, but I get the following error massage: by(AlexETF,AlexETF$Industry,function(a) {filename = paste(C:/ab/,gsub( ,,a$Industry[1]),.txt,sep=) + print(filename) + write.table(a[,3,drop=FALSE],quote=FALSE,col.names=FALSE,row.names=FALSE) + } + )

Re: [R] Data Manipulation

2010-01-21 Thread Peter Rote
Thank you Dieter and Rolf, I have solved the slash Problem, but I still struggling with the output files. I have tried this by(AlexETF,AlexETF$Industry,function(a) {filename = paste(C:/ab/,gsub( ,,a$Industry[1]),.txt,sep=) print(filename) write.table(a,file=filename,col.names

[R] Data Manipulation

2010-01-20 Thread Peter Rote
Dear All, I would like to to group the Ticker by Industry and create file names from the Industry Factor and export to a txt file. I have tried the folowing ind=finvizAllexETF$Industry ind is then Aluminum Business Services Regional Airlines ind2=gsub( ,,ind) ind3 [1] Aluminum

Re: [R] Data Manipulation

2010-01-20 Thread Peter Rote
Thank you Dieter, but i still have a problem to write to file. The problem is the slash in file names (Aerospace/Defense Products Services ). If i want it to C:/ab/ so C:/ab/AdvertisingAgencies.txt is ok but C:/ab/Aerospace/Defense-MajorDiversified.txt is not head(AlexETF)

Re: [R] Data Manipulation

2010-01-20 Thread Peter Rote
by the way how do i change the output 1016 Advertising Agencies CMM 1803 Advertising Agencies FMCN 2427 Advertising Agencies IPG 3093 Advertising Agencies MWW 3372 Advertising Agencies OMC 4809 Advertising Agencies VCLK 4832 Advertising Agencies VISN 5005 Advertising Agencies WPPGY 5089