collapseToString | R Documentation |
Collapse to string
collapseToString(object, ...)
## S4 method for signature 'DFrame'
collapseToString(object, sep = ", ", sort = FALSE, unique = FALSE)
## S4 method for signature 'atomic'
collapseToString(object, sep = ", ", sort = FALSE, unique = FALSE)
## S4 method for signature 'data.frame'
collapseToString(object, sep = ", ", sort = FALSE, unique = FALSE)
## S4 method for signature 'matrix'
collapseToString(object, sep = ", ", sort = FALSE, unique = FALSE)
object |
Object. |
sep |
|
sort |
|
unique |
|
... |
Additional arguments. |
atomic
: character(1)
.
dim
: Object of same class, collapsed to a single row.
Updated 2021-09-03.
toString()
.
## character ====
groceries <- c(NA, NA, "milk", "eggs", "eggs", "veggies")
collapseToString(
groceries,
unique = TRUE,
sort = TRUE
)
collapseToString(
groceries,
unique = FALSE,
sort = FALSE
)
## numeric ====
collapseToString(seq(1:5))
## logical ====
collapseToString(c(TRUE, FALSE))
collapseToString(c(NA, NaN))
## data.frame ====
df <- datasets::iris
df <- head(df)
df <- collapseToString(df, sort = TRUE, unique = TRUE)
t(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.