Learn R Programming

frab (version 0.0-6)

misc: Miscellaneous functions

Description

This page documents various functions that work for frabs, and I will add to these from time to time as I add new functions that make sense for frab objects. To use functions like sin() and abs() on frab object x, work with values(x) (which is a disord object). However, there are a few functions that are a little more involved:

  • length() returns the length of the data component of the object.

  • which() returns an error when called with a frab object, but is useful here because it returns a disind when given a Boolean disord object. This is useful for idiom such as x[x>0]

  • Functions is.na() and is.notna() return a disind object

Usage

# S4 method for frab
length(x)

Value

Generally return frabs

Arguments

x

Object of class frab

Author

Robin K. S. Hankin

See Also

extract

Examples

Run this code


(a <- frab(c(a=1,b=NA,c=44,x=NA,h=4)))
is.na(a)

(x <- frab(c(x=5,y=2,z=3,a=7,b=6)))
which(x>3)
x[which(x>3)]
x[which(x>3)] <- 4
x

is.na(x) <- x<3
x
x[is.na(x)] <- 100
x

y <- frab(c(a=5,b=NA,c=3,d=NA))
y[is.notna(y)] <- 199
y

Run the code above in your browser using DataLab