Re: [R] saving a character vector

From: Dominik Heier <dominik.heier_at_uni-bielefeld.de>
Date: Sun 05 Feb 2006 - 10:56:41 EST

Am Samstag, den 04.02.2006, 17:46 -0600 schrieb Taka Matzmoto:
> Hi R users
>
> I wrote a function that generates some character strings.
>
> generate.index<-function(n.item){
> for (i in 1:n.item)
> {
> for (j in ((i+1):n.item))
> {
>
> cat("i",formatC(i,digits=2,flag="0"),".",formatC(j,digits=2,flag="0"),"\n",sep="")

   ^
replace "cat" with "return"
> }
>
> }
> }
>
> I like to save what appears on the screen when I run using
> generate.index(10) as a character vector
>
> I used
> temp <- generate.index(10)
>
> but it didn't work.
>
> Could you provide some advice on this issue?
>
> Thanks in advance
>
> TM
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sun Feb 05 11:04:11 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:22 EST