ezCollapse | R Documentation |
This extends the functionality from paste(..., collapse=...)
by optionally removing empty characters, duplicates or NA values
ezCollapse(x, sep = "; ", na.rm = FALSE, empty.rm = FALSE, uniqueOnly = FALSE)
x |
a vector, matrix or list. |
sep |
the separator to use between values. |
na.rm |
a logical specifying whether to remove |
empty.rm |
a logical specifying whether to remove empty values. |
uniqueOnly |
a logical specifying whether to keep only unique values. |
Returns the values collapsed into one character.
Rehrauer, Hubert
Schmid, Peter
l1 = list(a=c(1,"",6),c=c("rsrg","yjrt",NA,6))
ezCollapse(l1,sep="_")
ezCollapse(l1,na.rm=T,empty.rm=T,uniqueOnly=T)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.