str2str-package {str2str}R Documentation

Structure to Structure

Description

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.

Limitations

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.

Abbreviations

See the table below

v

(atomic) vector

m

matrix

d

data.frame

a

(3D+) array

l

list

el

elements

nm

names

uv

unique values

lgl

logical

int

integer

dbl

double

num

numeric

chr

character

fct

factor

lvl

levels

vrb

variable

frm

formula

fun

function

rtn

return

str

structure

Author(s)

Maintainer: David Disabato ddisab01@gmail.com


[Package str2str version 1.0.0 Index]