Create a gist now

Instantly share code, notes, and snippets.

anonymous /gist:10018579
Created Apr 7, 2014

A minimal example to create the "cyclic namespace dependency" error in R when creating and loading a package
setClass("myClass", slots=c(name="character", value="numeric"))
setGeneric("myMethod", function(object) standardGeneric("myMethod"))
setMethod("myMethod", "myClass", function(object) {
cat(object@name, "=", object@value)
})
myMethod <- function(x,y) {
return(x,y)
}
@giupo
giupo commented Nov 19, 2014

Dear LORD! They should give you a Nobel prize! Thank you. I hate R when it comes to this 😄

@wligtenberg

I also got caught by this one.
Even when they have a different number of arguments, this still causes the cyclic namespace error.
Thanks for the pointer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment