[R] Data Manipulation

Don MacQueen macq at llnl.gov
Fri Jan 22 16:20:14 CET 2010


Does this example help?


>  a <- matrix(letters[1:12], ncol=3)
>  a
      [,1] [,2] [,3]
[1,] "a"  "e"  "i"
[2,] "b"  "f"  "j"
[3,] "c"  "g"  "k"
[4,] "d"  "h"  "l"

>  write.table(a[,3,drop=FALSE],quote=FALSE,col.names=FALSE,row.names=FALSE)
i
j
k
l



At 4:11 PM -0800 1/21/10, Peter Rote wrote:
>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 = FALSE)    
>     }
>  )
>
>and this
>
>  by(AlexETF,AlexETF$Industry,function(a) {filename = paste("C:/ab/",gsub("
>","",a$Industry[1]),".txt",sep="")
>         print(filename)
>	write(as.character(a),file=filename)    
>     }
>  ) 
>
>
>I want in each file just the ticker with out any quotations mark.
>
>CMM
>FMCN
>IPG
>MWW
>
>Thanks in advance,
>Peter
>
>--
>View this message in context: 
>http://*n4.nabble.com/Data-Manipulation-tp1018249p1073567.html
>Sent from the R help mailing list archive at Nabble.com.
>
>______________________________________________
>R-help at r-project.org mailing list
>https://*stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide http://*www.*R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.


-- 
--------------------------------------
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA
925-423-1062



More information about the R-help mailing list