inspect: Inspect internal attributes of R objects.

Description Usage Arguments Non-standard evaluation See Also Examples

View source: R/inspect.r

Description

typename determines the internal C typename, address returns the memory location of the object, and refs returns the number of references pointing to the underlying object.

Usage

1
2
3
4
5
6
7
8
9

Arguments

x

name of object to inspect. This can not be a value.

env

When inspecting environments, don't go past this one.

Non-standard evaluation

All functions uses non-standard evaluation to capture the symbol you are referring to and the environment in which it lives. This means that you can not call any of these functions on objects created in the function call. All the underlying C level functions use Rf_findVar to get to the underlying SEXP.

See Also

Other object inspection: ftype, otype

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
x <- 1:10
## Not run: .Internal(inspect(x))

typename(x)
refs(x)
address(x)

y <- 1L
typename(y)
z <- list(1:10)
typename(z)
delayedAssign("a", 1 + 2)
typename(a)
a
typename(a)

x <- 1:5
address(x)
x[1] <- 3L
address(x)

hadley/pryr documentation built on Feb. 20, 2018, 6:11 a.m.