I'm using RStudio to create own packages, which has worked well so far. When I build a package now by 'Build Source Package' of RStudio (to move the package from my Windows machine to a Linux machine) everything seems fine. I install the package on the Linux machine, load it with require (or library), but no function can be found! The error is
object 'somefunction' not found
==> roxygen2::roxygenize('.', roclets=c('rd', 'collate', 'namespace', 'vignette'))
First time using roxygen2. Upgrading automatically...
Paket 'nlme' wurde unter R Version 3.2.5 erstellt
==> Rcmd.exe build myPackage
* checking for file 'myPackage/DESCRIPTION' ... OK
* preparing 'myPackage':
* checking DESCRIPTION meta-information ... OK
* cleaning src
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
Removed empty directory 'myPackage/data'
* building 'myPackage_2.0.0.tar.gz'
Source package written to D:/Code
# Generated by roxygen2: do not edit by hand
==> Rcmd.exe INSTALL --no-multiarch --with-keep.source myPackage
* installing to library 'C:/Users/user/Documents/R/win-library/3.2'
* installing *source* package 'myPackage' ...
make: Nothing to be done for `all'.
installing to C:/Users/user/Documents/R/win-library/3.2/myPackage/libs/x64
** byte-compile and prepare package for lazy loading
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (myPackage)
I had the same problem trying to create a package. I got it to work by adding
#' @export before each function, as explained on here.
@exportline is critical. This tells
Roxygen2to add this function to the NAMESPACE file, so that it will be accessible to users. For your first R package, you’ll probably want to include
@exportfor each of your functions.