Our team created a user-defined R package for a project. When we created this package, we did so on a Windows OS and included the name of the package we built as a prefix whenever we call one of its R functions (e.g., dplyr::filter()). However, now that our RStudio server is hosted in Linux as opposed to the Windows environment that it was in previously, I'm running into an error trying to call the package functions with the prefix included:
Table_A1 <- package_name::Table_A1func(year, data)
Error: 'Table_A1func' is not an exported object from 'namespace:package_name'
However, when I remove the package name prefix, it runs as expected.
Table_A1 <- Table_A1func(year, data)
This only seems to be an issue with the R package we built and not with any other packages we call in from CRAN. Please note that we are using
devtools to develop the package and we're using R 3.5.0. We are not able to update to a more recent version of R due to project requirements. We'd like to be able to retain the use of the package prefix for two reasons:
- Ensure there are no namespace conflicts with other packages in case functions have the same name;
- Avoid going through hundreds of scripts that use the package prefix as this method was integrated throughout all the scripts in our package.