CheckNames: Function to test the identity of variable names in two data...

Description Usage Arguments Value Examples

View source: R/Utilities.R

Description

CheckNames takes two data frames and compares the included variable names.

Usage

1
2
CheckNames(data1, data2, identical.order = TRUE,
  names.data1.only = FALSE)

Arguments

data1

A data frame.

data2

A data frame.

identical.order

Whether the variables/columns are required to be in the same position in both data sets. The default is identical.order = TRUE, if identical.order = FALSE the test is with respect to identical spelling only and irrespective of the relative position in the respective data frames.

names.data1.only

Not yet implemented but intended as follows: If names.data1.only = TRUE testing is only with respect to the existence and spelling of all variables in data1 (useful for testing if a new version of a data set (data2) contains all of the variables in an earlier version (data1) where it is understood that new variables may have been added to the new version).

Value

TRUE or FALSE depending on the testing result.

Examples

1
CheckNames(data1 = example_data, data2 = example_data) # Trivially \code{TRUE}, of course.

FrThomas/risyphus documentation built on Dec. 6, 2019, 6:27 a.m.