[R] Unexpected behavior with abbreviation of an argument to paste

Dennis Fisher fisher at plessthan.com
Sun Jan 27 22:10:44 CET 2013


R 2.15.1
OS X

Colleagues,

I encountered the following unexpected behavior today:

The following command yielded the expected result:
	paste(c("TEXT1", "TEXT2"), collapse="|")
Result:
	[1] "TEXT1|TEXT2"

However, abbreviating "collapse" by even one character:
	paste(c("TEXT1", "TEXT2"), collaps="|") 
 yielded the following:
	[1] "TEXT1 |" "TEXT2 |" >

My experience has been that one can abbreviate these options as long as there is no ambiguity.  For example, the "ignore.case" argument for grep can be abbreviated to "ig" (shortening it to a single character creates an ambiguity).

Is there something special about "collapse" that I am missing?

Dennis

Dennis Fisher MD
P < (The "P Less Than" Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com



More information about the R-help mailing list