| as_charpack | R Documentation |
Converts a character vector (or anything as.character() accepts) to a
charpack, copying its strings. If x is already a charpack it is
returned unchanged. Names are preserved; other attributes are dropped.
as_charpack(x)
x |
object to convert. |
A charpack stays compact while it is read through charport, and vector
subsets such as x[i] stay packed. Reading individual strings from R, such
as x[[1]] or print(x), extracting matrix columns, or modifying elements
materializes the whole vector. This makes it mainly useful for testing code
that reads strings through charport.
A charpack (an ALTREP character vector).
x <- as_charpack(c("a", NA, "b"))
is_charpack(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.