misc function

Miscellaneous functions

Miscellaneous functions

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

## S4 method for signature 'frab' length(x)

Arguments

  • x: Object of class frab

Returns

Generally return frabs

Author(s)

Robin K. S. Hankin

Note

Constructions such as !is.na(x) do not work if x is a frab object: this is because is.na() returns a disind object, not a logical. Use is.notna() to identify elements that are not NA.

See Also

extract

Examples

(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
  • Maintainer: Robin K. S. Hankin
  • License: GPL (>= 2)
  • Last published: 2024-07-24