[R] saving a character vector

Taka Matzmoto sell_mirage_ne at hotmail.com
Sun Feb 5 00:46:22 CET 2006


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="")

            }

    }
                                }

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




More information about the R-help mailing list