Hi I wrotte this function but when I get the "tmp.xls" file it shows data in a rare way. I mean not appears a matrix with 2000 rows and 100 columns. Can anyone help me, guide me? kim<-function(){ tmp<-randz<-matrix(rnorm(200000, mean=0,sd=0.01 ),2000,100); dim(tmp) write(tmp,file="tmp.xls") Thanks in advance. On the other hand, everytime I execute a function that is locatd in my documents I must open it source(file.choose()) , there is a folder where to put my function to not necesessary run prevously source(file.choose()). Thanks in advance. } [[alternative HTML version deleted]]
Jose Narillos de Santos wrote:> Hi I wrotte this function but when I get the "tmp.xls" file it shows data > in a rare way. I mean not appears a matrix with 2000 rows and 100 columns. > Can anyone help me, guide me? > > kim<-function(){ > > tmp<-randz<-matrix(rnorm(200000, mean=0,sd=0.01 ),2000,100); > > dim(tmp) > > write(tmp,file="tmp.xls")See ?write and its ncolumns argument. You want either to change that one or you might want to use write.table.> Thanks in advance. > > > > On the other hand, everytime I execute a function that is locatd in my > documents I must open it source(file.choose()) , there is a folder where to > put my function to not necesessary run prevously source(file.choose()).See ?startup Uwe Ligges> Thanks in advance. > > > > > } > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.
On Tue, Jul 21, 2009 at 2:28 PM, Jose Narillos de Santos<narillosdesantos at gmail.com> wrote:> Hi I wrotte this function but when I get the "tmp.xls" file ?it shows data > in a rare way. I mean not appears a matrix with 2000 rows and 100 columns. > Can anyone help me, guide me?Short answer: ?write> write(tmp,file="tmp.xls")You have to add an ncolumns option like write(tmp,file="tmp.xls",ncolumns=100). The default is five columns. -- Michael Knudsen micknudsen at gmail.com http://lifeofknudsen.blogspot.com/
>> On the other hand, everytime I execute a function that is locatd in >> my >> documents I must open it source(file.choose()) , there is a folder >> where to >> put my function to not necesessary run prevously >> source(file.choose()). > > See ?startupRather: ?Startup -steve -- Steve Lianoglou Graduate Student: Physiology, Biophysics and Systems Biology Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact