Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

check_names

Check if character vector contains variable names


Description

Function used to check if a string, or a character vector contains variable names of a given data frame.

Usage

check_names(df, var_names, boolean = TRUE)

Arguments

df

a data frame.

var_names

Character vector to be compared with the data frame names.

boolean

Boolean object used to define if the output is going to be a boolean object TRUE , or a string FALSE. Default: TRUE.

Details

Function used to check if a string, or a character vector contains variable names of a given data frame. This functions is mainly used to error-proof other functions of this package,

Author(s)

Sollano Rabelo Braga sollanorb@gmail.com

Examples

library(forestmangr)

check_names(iris, "Species")
check_names(iris, "Species", boolean = FALSE )

check_names(iris, c("Especies", "Setal.Width") )
check_names(iris, c("Especies", "Setal.Width"), boolean = FALSE)

forestmangr

Forest Mensuration and Management

v0.9.3
MIT + file LICENSE
Authors
Sollano Rabelo Braga [aut, cre, cph], Marcio Leles Romarco de Oliveira [aut], Eric Bastos Gorgens [aut]
Initial release
2021-01-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.