dataview (version 2.1.1)

getOpt: Retrieves package options

Description

The dataview package contains a number of option for tailoring its behaviour. These options are stored as a named list in a single global varible named "dataview". To overwrite an option fetch the default values with default.options, modify the returned results and set it back as in the example below.

Usage

getOpt(x)
default.options()

Arguments

x
Option to retrieve.

Details

Below is a description of the available options, but to understand how they work it is probably easier to directly study the return value of default.options.
align
Column alignment, left or right.

columns
A named list with columns to use in whos. The object element should be a named list of functions to be applied on each object that is to be queried. The envir element should be a named list of functions to be applied on the object or environment on which whos is called together with its "accessors", which are object names (for environments) or named indices (for everything else). All functions should return a vector of values that can be used as a data.table column.

print
A named list of custom print functions. By default each column of a whos object is printed in a similar way as data.table or data.frame. If you wish to override this behaviour for a given column, please supply a named print function here. The function will be given the column as returned by the corresponding column function above, and should produce a character vector.

summary
A list of named summary functions. These are fed a column and should return a single value.

Examples

Run this code
# This shows how to modify a column presented by whos.
# The new function only reports the size of non-S4 objects
# to improve execution time.
opt <- default.options()
opt$columns$bytes <- function(x) if(isS4(x)) NA else object.size(x)
options(dataview = opt)

Run the code above in your browser using DataCamp Workspace