GuessDType | R Documentation |
Wrapper around hdf5r::guess_dtype
, allowing
for the customization of string types rather than defaulting to
variable-length ASCII-encoded strings. Also encodes logicals as
H5T_INTEGER
instead of H5T_LOGICAL
to ensure cross-language compatibility (controlled via
package options)
GuessDType(x, stype = "utf8", ...)
x |
The object for which to guess the HDF5 datatype or the dimension or the number of elements |
stype |
Type of string encoding to use, choose from:
|
... |
Arguments passed on to
|
An object of class H5T
guess_dtype
BoolToInt
StringType
# Characters can either be variable-width UTF8-encoded or
# fixed-width ASCII-encoded
SeuratDisk:::GuessDType(x = 'hello')
SeuratDisk:::GuessDType(x = 'hello', stype = 'ascii7')
# Data frames are a compound type; character columns follow the same rules
# as character vectors
df <- data.frame(x = c('g1', 'g2', 'g3'), y = 1, 2, 3, stringsAsFactors = FALSE)
SeuratDisk:::GuessDType(x = df)
SeuratDisk:::GuessDType(x = df, stype = 'ascii7')
# Logicals are turned into integers to ensure compatibility with Python
# TRUE evaluates to 1, FALSE to 0, and NA to 2
SeuratDisk:::GuessDType(x = c(TRUE, FALSE, NA))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.