Create a gist now

Instantly share code, notes, and snippets.

anonymous /gist:10018579
Created Apr 7, 2014

Embed
What would you like to do?
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

This comment has been minimized.

Show comment
Hide comment
@giupo

giupo Nov 19, 2014

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

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

This comment has been minimized.

Show comment
Hide comment
@wligtenberg

wligtenberg Feb 18, 2015

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!

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