extract_root_and_last_member: Extract the last member in a string representing an object

Description Usage Arguments Value

View source: R/functions.r

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

1

Arguments

full_name

character scalar from which we should keep the piece that comes after the last $ sign.

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").


envnames documentation built on Dec. 8, 2020, 9:07 a.m.