Learn R Programming

ref (version 0.95)

is.ref: checking (for) references

Description

is.ref checks whether an object inherits from class "ref". exists.ref checks whether an referenced object exists.

Usage

is.ref(x)
  exists.ref(ref)

Arguments

x
an object that might be a reference
ref
a reference as returned from ref or as.ref

Value

  • logical scalar

See Also

ref, exists, inherits, class

Examples

Run this code
v <- 1
  good.r <- as.ref(v)
  bad.r <- ref("NonExistingObject")
  is.ref(v)
  is.ref(good.r)
  is.ref(bad.r)
  exists.ref(good.r)
  exists.ref(bad.r)

Run the code above in your browser using DataLab