Skip to contents

Find the attribute containing the specified term in a given list.

Usage

findAttribute(term, list)

Arguments

term

The term to search for

list

The list to search within

Value

The attribute containing the term, or NULL if the term is not found in any attribute

Examples

# Create a list
my_list <- list(color = c("red", "blue", "green"),
                size = c("small", "medium", "large"),
                shape = c("circle", "square", "triangle"))

# Find the attribute containing "medium"
findAttribute("medium", my_list)
#> [1] "size"