This warning occurs when several RData files in the data directory of a package store a variable with the same name.
To reproduce, we create a package and save the cars dataset twice, for different files:
library(devtools) create("test") dir.create("test/data") save(cars, file = "test/data/cars1.RData") save(cars, file = "test/data/cars2.RData") check("test")
Exiting check includes the following lines:
The following important warnings were found: Warning: 'cars' objects are created by more than one data call
If you get this warning, you can find duplicate variable names using:
rdata_files <- dir("test/data", full.names = TRUE, pattern = "\\.RData$") var_names <- lapply( rdata_files, function(rdata_file) { e <- new.env() load(rdata_file, envir = e) ls(e) } ) Reduce(intersect, var_names)
source share