frab {frab}R Documentation

Creating frab objects

Description

Package idiom for creating frab objects

Usage

frab(x)
as.frab(x)
is.frab(x)
list_to_frab(L)

Arguments

x

object coerced to, or tested for, frab

L

List of two elements, a numeric vector named values and a character vector named names

Details

Function frab() is the creation method, taking a named numeric vector as its argument; it is the only function in the package that actually calls new("frab", ...).

Function as.frab() tries a bit harder to be useful and can coerce different types of object to a frab. If given a list it dispatches to list_to_frab(). If given a table it dispatches to table_to_frab(), documented at table.Rd.

Value

Returns a frab, or a boolean

Author(s)

Robin K. S. Hankin

See Also

frab-class

Examples


frab(c(x=6,y=6,z=-4,u=0,x=3))

as.frab(c(a=2,b=1,c=77))

as.frab(list(names=letters[5:2],values=1:4))

x <- rfrab()
y <- rfrab()
x+y


[Package frab version 0.0-3 Index]