Hi, is there a possibilty to get my function output with "cat " as data.frame.rows with variables ? Var1---------------- 8 15 1 3 Var2---------------- 0.170 0.319 0.0213 0.0638 Var3---------------- 83.8 88.6 90 75 Var4---------------- 84.3 84.3 100 83.3 Var5---------------- 62.5 56 20 53.3 function(data.frame) { .... .... cat("Var1",Var1.r,"\n") cat("Var2",Var2.r,"\n") cat("Var3",Var3.r,"\n") cat("Var4",Var4.r,"\n") cat("Var5",tapply(VAR.X,VAR.X,mean,na.rm=TRUE),"\n") } example: Var1 Var2 Var3 Var4 Var5 23 34 65 67 56 56 54 54 34 45 15 25 34 34 23 really thanks for advance & regards,christian -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Thu, 20 Jun 2002, Christian Schulz wrote: |Hi, |is there a possibilty to get my function output with "cat " |as data.frame.rows with variables ? | |Var1---------------- 8 15 1 3 |Var2---------------- 0.170 0.319 0.0213 0.0638 ... It is unfortunately not quite clear to me what do you want. I think if you want to get _output from cat()_ into a data frame, the only possibility is to save the region into a file and then read in as data frame (using read.table(... row.names=T). I would rather suggest to do it a) automatically, using sink() to redirect the output to a file, and then reading the file in again, perhaps correcting for some syntax problems as ------ signs in your example, and thereafter read it in as a data.frame. b) without any printing at all, putting values directly into a data.frame instead. It depends on, what you actually are doing. You should explain better, if I was completely missing the point. Ott -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
OK , many thanks that's a solution ! regards,christian Am 20.06.2002 18:05:49, schrieb Ott Toomet <siim at obs.ee>:>On Thu, 20 Jun 2002, Christian Schulz wrote: > > |Hi, > |is there a possibilty to get my function output with "cat " > |as data.frame.rows with variables ? > | > |Var1---------------- 8 15 1 3 > |Var2---------------- 0.170 0.319 0.0213 0.0638 >... > >It is unfortunately not quite clear to me what do you want. I think if you >want to get _output from cat()_ into a data frame, the only possibility is >to save the region into a file and then read in as data frame (using >read.table(... row.names=T).> >I would rather suggest to do it > >a) automatically, using sink() to redirect the output to a file, and then >reading the file in again, perhaps correcting for some syntax problems as >------ signs in your example, and thereafter read it in as a data.frame. > >b) without any printing at all, putting values directly into a data.frame >instead. It depends on, what you actually are doing. > > >You should explain better, if I was completely missing the point. > >Ott > >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Seemingly Similar Threads
- serie de tiempo incompleta: rellenar sólo fechas (claudiomet)
- calculating weighted correlation coefficients
- Sum of a couple of variables of which a few have NA values
- reading from text file that have different rowlength and create a data frame
- How do I convert a XML file to a data.frame?