I`m working in an existing program that uses a system of R6Class modules. An example function is stored in a file son.R and looks like:
#' @importFrom R6 R6Class
son_class <- R6Class("son", inherit = mother_class,
private = list( ... Some private elements ... ),
public = list(
initialize = function(x, y, z) {
...Some code...
super$initialize(x, y)
},
calculate = function(x,y,z) {
... More Code ...
calc_son(x,y,z)
}
)
)
#' @inheritParams ...
#' @return ...
#' @template ...
#' @examples ...
#' @export
son <- function(x = "son", y, z) {
son_class$new(x, y, z)
}
The authors of the package say that the way to create new modules is by creating new R6Classes that inherit from mother_class. Thus I create a daughter.R file that looks almost the same, just change the son to daughter, but when I try to compile, I get the following error:
==> R CMD INSTALL --no-multiarch --with-keep.source mypackage
Error in .install_package_code_files ( , instdir " . " ) :
missing files in 'path / to / mypackage / R' in the' Collate ' : daughter.R
ERROR: unable to collate and parse R files for package ‘mypackage’
Which may be the source of this error. I am following the authors instruction verbatim.