Package narray. January 28, 2018

Similar documents
Package dat. January 20, 2018

Package fastdummies. January 8, 2018

Package kdtools. April 26, 2018

Package stapler. November 27, 2017

Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package slam. December 1, 2016

Package slam. February 15, 2013

Package catenary. May 4, 2018

Package ggimage. R topics documented: November 1, Title Use Image in 'ggplot2' Version 0.0.7

Package assertive.code

Package Matrix.utils

Package messaging. May 27, 2018

Package keyholder. May 19, 2018

Package spark. July 21, 2017

Package ggimage. R topics documented: December 5, Title Use Image in 'ggplot2' Version 0.1.0

Package gggenes. R topics documented: November 7, Title Draw Gene Arrow Maps in 'ggplot2' Version 0.3.2

Package condformat. October 19, 2017

Package rgho. R topics documented: January 18, 2017

Package splithalf. March 17, 2018

Package jdx. R topics documented: January 9, Type Package Title 'Java' Data Exchange for 'R' and 'rjava'

Package docxtools. July 6, 2018

Package hypercube. December 15, 2017

Package validara. October 19, 2017

Package crossword.r. January 19, 2018

Package kirby21.base

Package labelvector. July 28, 2018

Package smoothr. April 4, 2018

Package canvasxpress

Package labelled. December 19, 2017

Package lumberjack. R topics documented: July 20, 2018

Package utf8. May 24, 2018

Package bisect. April 16, 2018

Package robotstxt. November 12, 2017

Package zebu. R topics documented: October 24, 2017

Package statar. July 6, 2017

Package reval. May 26, 2015

Package calpassapi. August 25, 2018

Package meme. November 2, 2017

Package qualmap. R topics documented: September 12, Type Package

Package crochet. January 8, 2018

Package widyr. August 14, 2017

Package Rspc. July 30, 2018

Package projector. February 27, 2018

Package diagis. January 25, 2018

Package rprojroot. January 3, Title Finding Files in Project Subdirectories Version 1.3-2

Package tidyimpute. March 5, 2018

Package rsppfp. November 20, 2018

Package ECctmc. May 1, 2018

Package CUFF. May 28, 2018

Package incidence. August 24, Type Package

Package postgistools

Package dostats. R topics documented: August 29, Version Date Title Compute Statistics Helper Functions

Package svalues. July 15, 2018

Package datasets.load

Package states. May 4, 2018

Package condusco. November 8, 2017

Package pdfsearch. July 10, 2018

Package rtext. January 23, 2019

Package redux. May 31, 2018

Package infer. July 11, Type Package Title Tidy Statistical Inference Version 0.3.0

Package easysdctable

Package raker. October 10, 2017

Package customlayout

Package ruler. February 23, 2018

Package stringb. November 1, 2016

Package fastrtext. December 10, 2017

Package readxl. April 18, 2017

Package meme. December 6, 2017

Package GetoptLong. June 10, 2018

Package elasticsearchr

Package preprosim. July 26, 2016

Package datapasta. January 24, 2018

Package filematrix. R topics documented: February 27, Type Package

Package librarian. R topics documented:

Package reticulate. November 24, 2017

Package gcite. R topics documented: February 2, Type Package Title Google Citation Parser Version Date Author John Muschelli

Package WhiteStripe. April 19, 2018

Package postal. July 27, 2018

Package pwrab. R topics documented: June 6, Type Package Title Power Analysis for AB Testing Version 0.1.0

Package nonlinearicp

Package restorepoint

Package keep. R topics documented: December 16, 2015

Package githubinstall

Package zoomgrid. January 3, 2019

Package bazar. October 7, 2018

Package balance. October 12, 2018

Package rollply. R topics documented: August 29, Title Moving-Window Add-on for 'plyr' Version 0.5.0

Package gifti. February 1, 2018

Package autocogs. September 22, Title Automatic Cognostic Summaries Version 0.1.1

Package barcoder. October 26, 2018

Package lvec. May 24, 2018

Package nngeo. September 29, 2018

Package mgc. April 13, 2018

Package modules. July 22, 2017

Package io. January 15, 2018

Package jstree. October 24, 2017

Package rcmdcheck. R topics documented: November 10, 2018

Package fitur. March 11, 2018

Package dkanr. July 12, 2018

Transcription:

Package narray January 28, 2018 Title Subset- And Name-Aware Array Utility Functions Version 0.4.0 Author Michael Schubert <mschu.dev@gmail.com> Maintainer Michael Schubert <mschu.dev@gmail.com> Stacking arrays according to dimension names, subset-aware splitting and mapping of functions, intersecting arbitrary dimensions, converting to and from data.frames, and many other helper functions. URL https://github.com/mschubert/narray BugReports https://github.com/mschubert/narray/issues Depends R (>= 3.0.2) Imports reshape2, stats, stringr, utils License Apache License (== 2.0) file LICENSE LazyData true Encoding UTF-8 Suggests knitr, testthat VignetteBuilder knitr RoygenNote 6.0.1 NeedsCompilation no Repository CRAN Date/Publication 2018-01-28 21:13:00 UTC R topics documented: bind............................................. 2 collect............................................ 3 construct........................................... 3 dim............................................. 4 dimnames.......................................... 4 1

2 bind _if............................................ 5 filter............................................. 5 flatten............................................ 6 guess_structure....................................... 6 intersect........................................... 7 intersect_list......................................... 7 lambda............................................ 8 like............................................. 8 map............................................. 9 map_simple......................................... 9 mask............................................. 10 match............................................ 10 melt............................................. 11 named_dots......................................... 11 rep.............................................. 12 restore_null_dimnames................................... 12 split............................................. 13 stack............................................. 13 subset............................................ 14 translate........................................... 14 vectors_to_row_or_col................................... 15 which............................................ 15 %or%............................................ 16 Inde 17 bind Binds arrays together disregarding names Binds arrays together disregarding names bind(..., = length(dim(arraylist[[1]])) + 1)... N-dimensional arrays, or a list thereof Along which ais to bind them together (default: new ais) A joined array

collect 3 collect Converts a logical matri to a list of character vectors This currently only supports with only one non-zero element collect(, = 2) A logical matri Which ais to spread mask on A character vector or list thereof construct A wrapper around reshape2::acast using a more intuitive formula synta The construct() function can be called either with the data.frame as the first argument or the formula and then specify data=<data.frame> construct(data, formula = guess_structure(data), fill = NA, name_aes = TRUE) data A data frame formula A formula: value ~ ais1 [+ ais2 + ais n..] fill name_aes A structured array to fill array with if undefined Keep column names of data as ais names

4 dimnames dim base::dim, but returning 1 for vector base::dim, but returning 1 for vector dim() Object to get dimensions on dimnames Return dimension names of an array respecting the number of dimensions Act on each element if is a list dimnames(, = TRUE, null_as_integer = FALSE, =!identical(, TRUE)) An n-dimensional array Limit to dimension (default: all) null_as_integer Whether nameless dimensions should be NULL or numbered Drop list of only one ais requested (default: if not returning all dimensions) A list of dimension names with length length(ndim(x))

_if 5 _if Drop unused dims if flag is TRUE Drop unused dims if flag is TRUE _if(, flag) flag An array object Whether to unused dimensions The object in full or with ped dimensions filter Function to discard subsets of an array (NA or ) Function to discard subsets of an array (NA or ) filter(x,, FUN, subsets = base::rep(1, dim(x)[]), na.rm = FALSE) X FUN subsets na.rm An n-dimensional array Along which ais to apply FUN Function to apply, needs to return TRUE (keep) or FALSE Subsets that should be used when applying FUN Whether to omit columns and rows with NAs An array where filtered values are NA or ped

6 guess_structure flatten Flattens an array an ais Flattens an array an ais flatten(, = -1, name_sep = NA) name_sep Array Along which ais to bind them together (default: last) Which character to use for naming new arrays [default: NA, do not touch names] An array with n-1 dimensions guess_structure Infer array structure from data.frame Infer array structure from data.frame guess_structure(df, verbose = TRUE) df verbose A data.frame with ordered aes, value field last Print message with inferred structure (default: TRUE) A formula describing this structure

intersect 7 intersect Intersects all passed arrays a give dimension, and modifies them in place TODO: accept =c(1,2,1,1...) [maybe list w/ vectors as well?] TODO: accept data=env/list arg? [sig-comb/drug-tissue/assocs.r#62-65] intersect(..., = 1, envir = parent.frame(), = FALSE, fail_if_empty = TRUE)... Arrays that should be intersected The ais which to intersect envir A list or environment to act upon Drop unused dimensions on result fail_if_empty Stop if intersection yields empty set intersect_list Intersects a lits of arrays for common dimension names Intersects a lits of arrays for common dimension names intersect_list(l., = 1, = FALSE, fail_if_empty = TRUE) l. List of arrays to perform operations on The ais which to intersect Drop unused dimensions on result fail_if_empty Stop if intersection yields empty set

8 like lambda Lambda synta for array iteration Lambda synta for array iteration lambda(fml,, group = c(), simplify = TRUE, envir = parent.frame()) fml group simplify envir A call prefied with a tilde A named vector which objects to subset (eg: c(=1)) Not implemented Return array instead of inde+result if scalar Environment where variables can be found like Reshapes to be like like, including dimension names Reshapes to be like like, including dimension names like(, like) like An n-dimensional array An n-dimensional array whose form X should inherit An array with values of X and structure of like

map 9 map Maps a function an array preserving its structure Maps a function an array preserving its structure map(x,, FUN, subsets = base::rep(1, dim(x)[]), = TRUE,...) X An n-dimensional array Along which ais to apply the function FUN A function that maps a vector to the same length or a scalar subsets Whether to apply FUN the whole ais or subsets thereof Remove unused dimensions after mapping; default: TRUE... Other arguments passed to FUN An array where FUN has been applied map_simple Apply function that preserves order of dimensions Apply function that preserves order of dimensions map_simple(x,, FUN, = TRUE,...) X An n-dimensional array Along which ais to apply the function FUN A function that maps a vector to the same length or a scalar Remove unused dimensions after mapping; default: TRUE... passed to the function An array where FUN has been applied

10 match mask Converts a list of character vectors to a logical matri Converts a list of character vectors to a logical matri mask(, = 2) A list of character vectors Which ais to spread mask on A logical occurrence matri match match() function with etended functionality match() function with etended functionality match(, from, to, filter_from = NULL, filter_to = NULL, data = parent.frame(), fuzzy_level = 0, table = FALSE, na_rm = FALSE, warn =!table && fuzzy_level > 0) from to filter_from filter_to data fuzzy_level table na_rm warn Vector of identifiers that should be mapped Vector of identifiers that can be mapped Matched mapping for all identifiers Restrict matching to a subset from from Restrict matching to a subset from to List containing the data from and to reference 0 for eact, 1 punctuation, and 2 closest character Return a matching table instead of just the matches Flag to remove items that can not be mapped Display warning for all fuzzy matches

melt 11 Mapped values melt Function to melt data.frame from one or multiple arrays Function to melt data.frame from one or multiple arrays melt(..., dimnames = NULL, na_rm = TRUE)... Array[s] or data.frame[s] to be melted dimnames List of names the dimensions (instead of VarX ) na_rm Remove rows with NAs named_dots Return a list of named dot-arguments Return a list of named dot-arguments named_dots(...)... Function arguments Named function arguments

12 restore_null_dimnames rep Repeats an array an arbitrary ais Repeats an array an arbitrary ais rep(, n, = 1) crep(, n) rrep(, n) An array object n Integer, how often to repeat Along which ais to repeat (default: 1) An array that is repeated n times on ais restore_null_dimnames If no dimnames, return NULL and not list of NULLs If no dimnames, return NULL and not list of NULLs restore_null_dimnames() An array object The object with NULL if no dimnames

split 13 split Splits and array a given ais, either totally or only subsets Splits and array a given ais, either totally or only subsets split(x,, subsets = c(1:dim(x)[]), = NULL) X subsets An array that should be split Along which ais to split; use -1 for highest dimension Whether to split each element or keep some together Remove unused dimensions after mapping default: if all resulting arrays have same number of dimensions A list of arrays that combined make up the input array stack Stacks arrays while respecting names in each dimension Stacks arrays while respecting names in each dimension stack(..., = length(dim(arraylist[[1]])) + 1, fill = NA, = FALSE, keep_empty = FALSE, fail_if_empty = TRUE)... N-dimensional arrays, or a list thereof fill keep_empty fail_if_empty Which ais arrays should be stacked on (default: new ais) for unknown values (default: NA) Drop unused dimensions (default: FALSE) Keep empty elements when stacking (default: FALSE) Stop if no arrays left after removing empty elements

14 translate A stacked array, either n or n+1 dimensional subset Subsets an array using a list with indices or names Subsets an array using a list with indices or names subset(x, inde, = -1, = FALSE) X inde The array to subset A list of vectors to use for subsetting, or vector if is given Along which dimension to subset if inde is a vector; default is last dimension; argument is ignored if X is a vector Remove unused dimensions after mapping; default: TRUE The subset of the array translate Translate an ais between two sets of identifiers Translate an ais between two sets of identifiers translate(, = 1, to, from = dimnames()[[]],..., FUN) A matri Along which ais to summarize to Names that this dimension should be summarized to from Names that match the dimension... Parameters passed to match FUN Which function to apply, default is throwing error on aggregation

vectors_to_row_or_col 15 A summarized matri as defined by from, to vectors_to_row_or_col Converts vectors in a list to row- or column vectors Converts vectors in a list to row- or column vectors vectors_to_row_or_col(list, ) list List of array-like elements and vectors Along which dimension vectors should be aligned List where vectors are replaced by row- or col vectors (2d) which A multidimensional which function A multidimensional which function which(, = TRUE) N-dimensional logical array Return a vector if called on a vector A matri with indices where A == TRUE

16 %or% %or% Operator for array-like logical operations Operator for array-like logical operations a %or% b a b First vector Second vector TRUE/FALSE for each element

Inde %or%, 16 bind, 2 collect, 3 construct, 3 crep (rep), 12 dim, 4 dimnames, 4 _if, 5 filter, 5 flatten, 6 guess_structure, 6 intersect, 7 intersect_list, 7 lambda, 8 like, 8 map, 9 map_simple, 9 mask, 10 match, 10 melt, 11 named_dots, 11 rep, 12 restore_null_dimnames, 12 rrep (rep), 12 split, 13 stack, 13 subset, 14 translate, 14 vectors_to_row_or_col, 15 which, 15 17