Package: str2str 1.0.0

str2str: Convert R Objects from One Structure to Another

Offers a suite of functions for converting to and from (atomic) vectors, matrices, data.frames, and (3D+) arrays as well as lists of these objects. It is an alternative to the base R as.<str>.<method>() functions (e.g., as.data.frame.array()) that provides more useful and/or flexible restructuring of R objects. To do so, it only works with common structuring of R objects (e.g., data.frames with only atomic vector columns).

Authors:David Disabato [aut, cre]

str2str_1.0.0.tar.gz
str2str_1.0.0.zip(r-4.5)str2str_1.0.0.zip(r-4.4)str2str_1.0.0.zip(r-4.3)
str2str_1.0.0.tgz(r-4.4-any)str2str_1.0.0.tgz(r-4.3-any)
str2str_1.0.0.tar.gz(r-4.5-noble)str2str_1.0.0.tar.gz(r-4.4-noble)
str2str_1.0.0.tgz(r-4.4-emscripten)str2str_1.0.0.tgz(r-4.3-emscripten)
str2str.pdf |str2str.html
str2str/json (API)

# Install 'str2str' in R:
install.packages('str2str', repos = c('https://ddisab01.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

On CRAN:

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

1.56 score 1 packages 12 scripts 344 downloads 1 mentions 76 exports 6 dependencies

Last updated 1 years agofrom:e3f555b5c8. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 20 2024
R-4.5-winOKNov 20 2024
R-4.5-linuxOKNov 20 2024
R-4.4-winOKNov 20 2024
R-4.4-macOKNov 20 2024
R-4.3-winOKNov 20 2024
R-4.3-macOKNov 20 2024

Exports:a2da2laa2lda2lma2vabind<-all_diffall_sameappend<-cat0cbind_fillcbind_fill_matrixcbind<-codesd2ad2dd2ldd2lvd2md2vdimlabelsdimlabels<-e2lfct2vgrabinbtwis.avectoris.cnumericis.colnamesis.Dateis.dummyis.emptyis.namesis.POSIXctis.POSIXltis.row.namesis.rownamesis.wholeJoinla2alaynamesld2ald2dld2vlm2alm2dlm2vlv2dlv2mlv2vm2dm2lvm2vndimnlaynot.colnamesnot.namesnot.row.namesnot.rownamesorder.custompickrbind<-snstack2t_listtry_exprtry_funundimundimlabelundimnameunstack2v2dv2fctv2frmv2lvv2m

Dependencies:abindbackportscheckmateplyrRcppreshape

Readme and manuals

Help Manual

Help pageTopics
Structure to Structurestr2str-package str2str
(3D+) Array to Data-Framea2d
(3D+) Array to List of (3D+) Arraysa2la
3D Array to List of Data-Framesa2ld
(3D) Array to List of Matricesa2lm
(3D+) Array to (Atomic) Vectora2v
Add array slices to 3D+ Array '`abind<-`' adds array slices to arrays as a side effect. It used the function 'abind' in the 'abind' package. The purpose of the function is to replace the need to use ary2 <- abind(ary1, mat1); ary3 <- rbind(ary2, mat2); ary4 <- rbind(ary3, mat3), etc. It allows you to specify the dimension you wish to bind 'along' as well as the dimname you wish to bind 'after'. Unlike '`cbind<-`', '`rbind<-`', and '`append<-`', it does not have overwriting functionality (I could not figure out how to code that); therefore, if 'value' has some dimnames that are the same as those in 'a', it will NOT overwrite them and simply bind them to 'a', resulting in duplicate dimnames.abind<-
Test if All Elements are Differentall_diff
Test if All Elements are the Sameall_same
Add Elements to Vectorsappend<-
Concatenate and Print with No Separatorcat0
Bind DataFrames Along Columns - Filling in Missing Rows with NAcbind_fill
Bind Matrices Along Columns - Filling in Missing Rows with NAcbind_fill_matrix
Add Columns to Data Objectscbind<-
Integer Codes of Factor Levelscodes
Data-Frame to (3D+) Array or Matrixd2a
Data-Frame to Data-Frame (e.g., factors to character vectors)d2d
Data-Frame to List of Data-Framesd2ld
Data-Frame to List of (Atomic) Vectorsd2lv
Data-Frame to Matrixd2m
Data-Frame to (Atomic) Vectord2v
Dimension labels (i.e., names of dimnames)dimlabels
Add Elements to Vectorsdimlabels<-
Environment to Liste2l
Factor to (Atomic) Vectorfct2v
'grab' extracts the contents of objects in an environment based on their object names as a character vector. The object contents are stored to a list where the names are the object names.grab
Elements Inbetween Values Within a (Atomic) Vectorinbtw
Test for an Atomic Vectoris.avector
Test for Character Numbersis.cnumeric
Test for `colnames`is.colnames
Test for a Date objectis.Date
Test for a Dummy Variableis.dummy
Test for Empty Charactersis.empty
Test for `names`is.names
Test for a POSIXct objectis.POSIXct
Test for a POSIXlt objectis.POSIXlt
Test for `row.names`is.row.names
Test for `rownames`is.rownames
Test for Whole Numbersis.whole
Join (or Merge) a List of Data-framesJoin
List of (3D+) Arrays to (3D+) Arrayla2a
Names of the Layers (the Third Dimension)laynames
List of Data-Frames to a 3D Arrayld2a
List of Data-Frames to Data-Frameld2d
List of Data-Frames to (Atomic) Vectorld2v
List of Matrices to 3D Arraylm2a
List of Matrices to Data-Framelm2d
List of Matrices to (Atomic) Vectorlm2v
List of (atomic) vectors to Data-Framelv2d
List of (atomic) Vectors to Matrixlv2m
List of (atomic) Vectors to (atomic) Vectorlv2v
Matrix to Data-Framem2d
Matrix to List of (Atomic) Vectorsm2lv
Matrix to (Atomic) Vectorm2v
Number of Object Dimensionsndim
Number of Layers (the Third Dimension)nlay
Identify Elements That are Not Colnamesnot.colnames
Identify Elements That are Not Namesnot.names
Identify Elements That are Not Row.namesnot.row.names
Identify Elements That are Not Rownamesnot.rownames
Custom Order Permutationorder.custom
Extract Elements From a (Atomic) Vectorpick
Add Rows to Data Objectsrbind<-
Set a Vector's Names as its Elementssn
Stack one Set of Variables from Wide to Longstack2
Transpose a Listt_list
Add Try to Expressiontry_expr
Add Try to Functiontry_fun
Undimension an Objectundim
Undimlabel an Objectundimlabel
Undimname an Objectundimname
Unstack one Set of Variables from Long to Wideunstack2
(Atomic) Vector to Data-Framev2d
Character Vector to (Unordered) Factorv2fct
Character Vector to Formulav2frm
(Atomic) Vector to List of (Atomic) Vectorsv2lv
(Atomic) Vector to Matrixv2m