cat() isn't doing what you think, and as.character() is unnecessary here because paste() takes care of that.
A couple of more elegant solutions have already appeared, but here's one that parallels your version: paste(c( rep( ".", 2 ), "a string", rep( ".", 3 )), collapse=" ") On Thu, Mar 25, 2010 at 2:53 PM, Jeff Brown <dopethatwantsc...@yahoo.com> wrote: > > Hi, > > I would expect the following: > > paste( > as.character( cat( rep( ".", 2 ) ) ), > "a string", > as.character( cat( rep( ".", 3 ) ) ) > ); > -- Sarah Goslee http://www.functionaldiversity.org ______________________________________________ R-help@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.