I've read most of Hadley Wickham's great book: http://r-pkgs.had.co.nz/, but I'm confused as to why my functions within my package can't find my other non-exported functions.
E.g I have
#' @export
#' @import ggmap
#' @import hexbin
map <- function(return.query, zoom, maptype, histObj) {
UseMethod("map")
}
#'
map.querySold <- function(query, zoom = 11, maptype = "roadmap") {
My Code
}
Running this with a clean enviroment and loading my package generates error:
> map(x) # x is of class querySold
Error in UseMethod("map") :
no applicable method for 'map' applied to an object of class "c('querySold', 'data.frame')"
What is wrong and how can I fix this? I thought that internal functions where always available to all other functions within the package?
It is not until I load all functions with devtools::load_all(".")
that it works.