[R-pkg-devel] Note: no function found corresponding to methods exports for show

Wojciech Achtelik w@chte||k @end|ng |rom gm@||@com
Sat Oct 7 12:25:14 CEST 2023


Hi,

I recently submitted my first R package to CRAN, and I encountered a NOTE
during the checking process. The NOTE looks like this:

=============================================================
Flavor: r-devel-linux-x86_64-debian-gcc, r-devel-windows-x86_64
Check: whether the namespace can be loaded with stated dependencies,
Result: NOTE
  Warning: no function found corresponding to methods exports from 'hmsr'
for: 'show'

  A namespace must be able to be loaded with just the base namespace
  loaded: otherwise if the namespace gets loaded by a saved object, the
  session will be unable to start.

  Probably some imports need to be declared in the NAMESPACE file.
=============================================================

I'm seeking help to understand and address this issue. show is defined like
this:

#' Show method for class "hms".#'#' @param object - hms s4 object#'#'
@return It returns the names of the slots and the classes associated
with the#' slots in the "hms" class. It prints call details.#'#'
@export#'#' @examples
#' f <- function(x) x
#' result <- hms(fitness = f, lower = -5, upper = 5)
#' show(result)
setMethod("show", "hms", function(object) {
  cat("An object of class \"hms\"\n")
  cat("\nCall:\n", deparse(object using call), "\n\n", sep = "")
  cat("Available slots:\n")
  print(methods::slotNames(object))})

And in the NAMESPACE there is a line that looks like this:

exportMethods(show)

I was investigating if the show is defined correctly and the GA package has
a very similar method:

setMethod("show", "ga",function(object)
 { cat("An object of class \"ga\"\n")
   cat("\nCall:\n", deparse(object using call), "\n\n",sep="")
   cat("Available slots:\n")
   print(slotNames(object))})

I could not reproduce this NOTE on my personal machine with Windows.
On Mac OS I have never experienced this NOTE.


Best regards

Wojciech Achtelik

	[[alternative HTML version deleted]]




More information about the R-package-devel mailing list