[R] duplicated function
Dennis Fisher
fisher at plessthan.com
Tue Nov 18 16:23:41 CET 2014
R 3.1.1
OS X
Colleagues
When I use the duplicated function, I often need to find both the duplicates and the original element that was duplicated. This can be accomplished with:
duplicated(OBJECT) | duplicated(OBJECT, fromLast=TRUE)
>From my perspective, an improvement in the duplicated function would be an option that accomplishes this with a single call to the function. This could either be:
1. a new option: all=TRUE (pick whatever name makes sense)
2. allowing fromLast to take a new value (e.g., NA, in the spirit of the xpd option in par())
If my suggestion would yield unintended consequences, it can certainly be ignored.
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
[[alternative HTML version deleted]]
More information about the R-help
mailing list