Create a new R list with n elements. The length can never be changed. This is a limitation on the R side. All we're doing here is calling Rf_allocVector in the R API to allocate a new list with n elements.
Call this to work with an existing R list. Creates a new R list with the same number of elements as v.
Convenience method that allows you to create an RList from a list in R by passing a string holding the R variable name.
Provided to make the RList a range. That allows iteration using a foreach loop.
Allows access to the elements of an RList by index number or by name. Note that it returns an Robj, which may or may not be protected. This is an example of the intended use case:
Can add an element by name. This is the idiomatic way to add elements to a list.
Provided to make the RList a range. That allows iteration using a foreach loop.
Add an Robj to the end of the list and set the name to name. Will throw an error if the RList is full.
Use this to return an RList to R.
If you want to add elements by index. Dangerous because there is nothing to prevent you from overwriting an existing element.
Needed for handling protection. You should not need to mess with this unless you know what you're doing. Might be made private in the future.
Used to make it more convenient to add new elements by name. Do not touch! Will probably be made private in the future.
Number of Robj held. Cannot be changed.
Names of objects. Lists in R can be accessed by name or index.
The most common way to pass multiple pieces of data in R is by putting them into a list. If you pass a list from R to D, you need some way to work with that data. If you want to return multiple items from D to R, the only way to do that is with a list.
Those are the only two use cases for this struct.