get8object: returns an object from a character(2) coding

Description Usage Arguments Details Value Examples

View source: R/f0.rbsb1.code.r

Description

Returns the object associated to two character strings. whi[1] designates a global variate and whi[2] indicates the way to interpret it.

Usage

1

Arguments

whi

The designation of the object.

whi[1] is the name of the object and whi[2] indicates the way interpret it. The different possibilities are:
When "o", the object is returned as it is (when it does not exist, NULL is returned).
When "c", must be a character.
When "n", must be a numeric.
When "d", must be a data.frame.
When "m", must be a matrix.
When "a", must be an array.
When "f", must be a function.
When "t1", must be a text file to be read with read.table.
When "t2", must be a text file to be read with read.csv.
When "t3", must be a text file to be read with read.csv2.
(when reading a file, the corresponding function is called with header=TRUE,comment.char="#".)

Details

Very similar in spirit to the function get8daf but much less specialized.

Value

The object. Except when whi[2]=="o" an error is issued if the object does not exist or is not from the expected class.

Examples

1
2
3
4
5
6
7
8
 rbsb3k("RESET"); # needed only for R checking, to be forgotten
 get8object(c("rbsb.cha0", "o"));
 #will rise an error
 #get8object(c("rbsb.cha0", "c"));
 uu <- "Bonjour";
 get8object(c("uu", "c"));
 get8object(c("rbsb.dfr1", "d"));
 get8object(c("rbsb.fun0", "f"));

rbsb documentation built on May 2, 2019, 4:41 p.m.

Related to get8object in rbsb...