You could define your own function:
paste0 <- function( ..., sep="" ) paste( ..., sep = sep )
which is used like this:
> paste0("large","st")
[1] "largest"
or perhaps you might want to define an infix operator to do
this:
"%+%" <- function(x,y) paste(x,y,sep="")
which is used like this:
> "large" %+% "st"
[1] "largest"
It would be nice if a convenience wrapper such as paste0 were
part of the base since I too find that I often use sep="" on
paste. Other areas of R such as ISOdate and table.csv are
wrappers.
---
Hello,
How do I permanently change the separator in "paste" and
"cat"
that by default is set to " " ?
(so that I dont have to say sep="" any time I use paste or cat)
regards, R. Alberts
--
Drs. R. Alberts
Groningen Bioinformatics Centre (GBIC)
Dep. of Mathematics and Computing Science
University of Groningen (RuG)
P.O. Box 800
9700 AV Groningen
The Netherlands
tel. Haren +31 50 363 8082
tel. Groningen +31 50 363 3957
You can use a wrapper: mypaste <- function(...) paste(..., sep="") HTH, Andy> From: Rudi Alberts > > Hello, > > How do I permanently change the separator in "paste" and "cat" > that by default is set to " " ? > (so that I dont have to say sep="" any time I use paste or cat) > > > > regards, R. Alberts > > > -- > Drs. R. Alberts > Groningen Bioinformatics Centre (GBIC) > Dep. of Mathematics and Computing Science > University of Groningen (RuG) > > P.O. Box 800 > 9700 AV Groningen > The Netherlands > > tel. Haren +31 50 363 8082 > tel. Groningen +31 50 363 3957 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > >------------------------------------------------------------------------------ Notice: This e-mail message, together with any attachments,...{{dropped}}
Hello, How do I permanently change the separator in "paste" and "cat" that by default is set to " " ? (so that I dont have to say sep="" any time I use paste or cat) regards, R. Alberts -- Drs. R. Alberts Groningen Bioinformatics Centre (GBIC) Dep. of Mathematics and Computing Science University of Groningen (RuG) P.O. Box 800 9700 AV Groningen The Netherlands tel. Haren +31 50 363 8082 tel. Groningen +31 50 363 3957