In my package I have redefined the find.package function to include custom search locations and would like data() to use my version of find.package() instead of the base version.
I have tried importing utils::data (as below). I have tried assigning data <- utils::data in my package but the namespace of my_package::data() is still utils. I have tried using conflicted.
#' Load data function
#'
#' @name data
#' @rdname data
#' @keywords internal
#' @export
#' @importFrom utils data
#' @usage data(foo)
NULL
If I copy/paste the utils::data() into my package the my_pkg::find.package() is used because the namespaces are the same. But I would prefer not to have an explicitly-coded copy of data in my package.
I just cannot find how (or if) I can import the utils::data() into my package's namespace or convince utils::data() to use my_pkg::find.package() instead of base::find.package()