has_tag {tagr}R Documentation

Check if an R object has specified tags

Description

This function checks if an existing R object has specified tags. The tags are stored as attributes of the object. If the specified object does not exist in the specified environment, an error is thrown.

Usage

has_tag(x, ..., envir = parent.frame())

Arguments

x

The name of the object to check (unquoted).

...

The tags to check for.

envir

The environment in which the object exists (defaults to the parent frame).

Value

A logical value indimessageing whether the object has all of the specified tags.

Examples

# create a vector and add some tags
x <- c(1, 2, 3)
add_tags(x, "foo", "bar")

# check if the vector has the specified tags
has_tag(x, "foo", "bar")


[Package tagr version 1.0.1 Index]