Learn R Programming

pepr (version 0.3.2)

.getSubscript: Get list subscript

Description

Based on available list element names and subscript value determine index of the element requested

Usage

.getSubscript(lst, i)

Arguments

lst

list to search subsript for

i

character or numeric to determine final list index

Value

numeric index of the requested element in the list

Examples

Run this code
# NOT RUN {
l = list(a="a", b="b")
.getSubscript(l, 1) == .getSubscript(l, "a")
# }

Run the code above in your browser using DataLab