powered by
This function checks if an object has a specific attribute and stops if not
check_attr(object, attr = "type", check = NULL, stop = TRUE)
Object of any kind
Character. Attribute to check
Character. Attribute value
Boolean. Stop if doesn't check?
No return value, called for side effects.
# NOT RUN { test <- data.frame() attributes(test) check_attr(test, "class", "data.frame") # check_attr(test, "class", "not.data.frame") # }
Run the code above in your browser using DataLab