extract_root_and_last_member {envnames} | R Documentation |
Extract the last member in a string representing an object
Description
Function that extracts the last name in a string representing an object as in e.g. obj$x$y
.
It returns a list containing both the piece before the last occurrence of $
and the name coming after it.
The object may or may not exist.
Usage
extract_root_and_last_member(full_name)
Arguments
full_name |
character scalar from which we should keep the piece that comes after the last |
Value
A list with two members: root
containing the path to the last name of the object expression
and name
, containing the last name in the object expression.
The root
is empty when there is no $
in the input string.
Ex: extract_root_and_last_member("obj$x$y")
returns list(root="obj$x", name="y")
.
[Package envnames version 0.4.1 Index]