RLink`
RLink`

RNull

RNull[]     is RLink's representation of an R NULL object.

Details and Options

  • RNull corresponds to the Wolfram Language's Null.
  • Unless you manually construct or otherwise work with the RLink internal form of expressions representing R objects, you are unlikely to be using this head.

Examples

Basic Examples  (1)

The Wolfram Language's Null is interpreted as R NULL during conversion to RLink's internal representation:

Of course, it also works in another direction:

You can set a variable (or part of an expression, e.g. part of a list) to NULL:

Comparison to NULL does not really workit returns a logical vector of length 0:

You can, however, test the type of the value stored in the test variable:

The proper way to test for NULL is via the is.null built-in R function:

Vectors of zero length are also considered NULL in R:

For this reason, assigning NULL to a vector's element is an error:

Assigning NULL to an element of a list is not an error, and effectively deletes that element from a list. Here is a test list:

This will assign NULL to its second element:

This is equivalent to removal of that element from a list:

In some sense, R NULL therefore combines the behavior of the Wolfram Language's Null and Sequence[].

Wolfram Research (2012), RNull, Wolfram Language function, https://reference.wolfram.com/language/RLink/ref/RNull.html.

Text

Wolfram Research (2012), RNull, Wolfram Language function, https://reference.wolfram.com/language/RLink/ref/RNull.html.

CMS

Wolfram Language. 2012. "RNull." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/RLink/ref/RNull.html.

APA

Wolfram Language. (2012). RNull. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/RLink/ref/RNull.html

BibTeX

@misc{reference.wolfram_2024_rnull, author="Wolfram Research", title="{RNull}", year="2012", howpublished="\url{https://reference.wolfram.com/language/RLink/ref/RNull.html}", note=[Accessed: 21-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_rnull, organization={Wolfram Research}, title={RNull}, year={2012}, url={https://reference.wolfram.com/language/RLink/ref/RNull.html}, note=[Accessed: 21-December-2024 ]}