utils: Utility functions

Description Usage Arguments Details Value

Description

get_metadata adds metadata to a list-like object.

outer_vec simply performs the cross-product, specifically x t(y), and assigns dimnames to the resulting matrix.

split_string inserts separator characters in a character string to truncate strings for printing.

vec.transform takes a vector and transforms it to have a new range, given the input, or the default values of [0, 1].

Usage

1
2
3
4
5
6
7
get_metadata(object)

outer_vec(x, y)

split_string(x, max_len = 80L, delim = "\\+", sep = "\n")

vec.transform(x, min.val = 0, max.val = 1)

Arguments

object

A list-like object

x

A character string

delim

Character specifying where to end a line if it is longer than max.len. Default: '+'

sep

Character specifying what to split by. Default: '\n' (a newline character)

min.val

the minimum value of the new range

max.val

the maximum value of the new range

max.len

Integer; the max length of one line. Default: 80

Details

If the object is a graph, graph-level attributes will be added. The elements added are:

The delim argument determines where to insert the separator. For example, given the default, it will attempt to insert newline characters only following a plus sign.

Value

get_metadata - the same object with version, system, and date information added

A vector of the transformed input.


brainGraph documentation built on Oct. 23, 2020, 6:37 p.m.

Related to utils in brainGraph...