Check names and rownamesSource:
object_has_names() checks if specified names are present in the given object.
object_has_rownames() checks if rownames are present in a dataframe.
A named object (an atomic vector, a list, a dataframe, etc.).
A single character or a vector of characters.
# check if specified names are present in the given object object_has_names(mtcars, "am") #>  TRUE object_has_names(anscombe, c("x1", "z1", "y1")) #>  TRUE FALSE TRUE object_has_names(list("x" = 1, "y" = 2), c("x", "a")) #>  TRUE FALSE # check if a dataframe has rownames object_has_rownames(mtcars) #>  TRUE