Checks names for SQLite
column name conventions and
applies appropriate variable name changes to GADSdat
or all_GADSdat
objects.
Details
Invalid column names in a SQLite
data base include
SQLite
keywords (seesqlite_keywords
) andcolumn names with a
"."
in it.
The corresponding variable name changes are
appending the suffix
"Var"
to allSQLite
keywords andchanging all
"."
in variable names to"_"
.
Note that avoiding "."
in variable names is beneficial for multiple reasons, such as
avoiding confusion with S3
methods in R
and issues when importing from Stata
.
Examples
# Change example data set (create an invalid variable name)
pisa2 <- changeVarNames(pisa, oldNames = "computer_age",
newNames = "computer.age")
#> computer.age has been renamed to computer_age
pisa3 <- checkVarNames(pisa2)