When I dispatch on the top level object, all the functions export to the namespace. Everything works as I would expect it to.
myfun <- function(obj) {
UseMethod("myfun",obj)
}
#' @export
myfun.this <- function()
Namespace:
S3Method(myfun,this)
export(myfun)
BUT, when I try to dispatch on an element within my object...
#' Subsets recoded data by a condition
#'
#' This function filters a list, data.frame or vector by a condition
#'
#' @param so A surv3 object
#' @param condition A positively stated condition or logical vector
#' @export
subset.surv3 <- function(so, condition) {
UseMethod("subset.surv3",so$recoded) # THIS PART
}
#' @export
subset.surv3.categorical <- function(so, condition) {
....
return(so)
}
#' @export
subset.surv3.continuous <- function(so, condition) {
...
return(so)
}
Namespace:
S3method(subset,surv3.categorical)
S3method(subset,surv3.continuous)
However, the functions are not exported.
I would have expected:
export(subset.surv3.categorical)
export(subset.surv3.continuous)
What am I doing wrong?