str2str-package | R Documentation |
str2str
is a package for converting R objects to
different structures. It focuses on four primary R objects: (atomic)
vectors, matrices, data.frames, and arrays as well as lists of these
objects. For example, converting a (atomic) vector to a data.frame (i.e.,
v2d()
) or a list of (atomic) vectors to a matrix (i.e.,
lv2m()
. The current version of the package does not have a function
for every convertion (e.g., a2m()
), but some additional convertion
functions may be included in future versions if I find a use for them. The
package was motivated by limitations of the base R as.<str>.<method>
suite of functions and the plyr
R package **ply(.fun = NULL)
suite of functions for converting R objects to different structures. While
those functions are often useful, there are times different conversions are
desired or different naming schemes are desired. That is what this package
offers R users. It also contains various utility functions for working with
common R objects. For example, is.colnames
and ndim
.
This packages does NOT handle the nuances of R objects.
It is not for comprehensive restructuring of any version of R objects, but
rather for restructuring commonly used versions of R objects. For example,
the functions are not tested with the raw and complex typeof atomic
vectors, list arrays, or data.frames containing non-atomic vector columns
(e.g., matrix or list columns). The base R as.<str>.<method>
functions allow for comprehensive restructuring of R objects; however, at
the cost of less convenient convertions for commonly used versions of R
objects. The str2str
package seeks to fill that gap in useability.
See the table below
(atomic) vector
matrix
data.frame
(3D+) array
list
elements
names
unique values
logical
integer
double
numeric
character
factor
levels
variable
formula
function
return
structure
Maintainer: David Disabato ddisab01@gmail.com
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.