I am trying to re-make a flow chart in R using the diagram package (v 1.6). I was able to make a chart using this exact script (which I modified from the example in the diagram documentation), but once I updated R to 3.0.0, the coordinates function gives me an error. Here is an example:
library(graphics)
library(diagram)
par(mar = c(1, 1, 1, 1))
openplotmat()
elpos<-coordinates(c(1,1,2,4))
Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘coordinates’ for signature ‘"numeric"’
I am still new to R and code, etc., so when I run traceback(), I really don't understand what it is telling me:
3: stop(gettextf("unable to find an inherited method for function %s for signature %s",
sQuote(fdef@generic), sQuote(cnames)), domain = NA)
2: (function (classes, fdef, mtable)
{
methods <- .findInheritedMethods(classes, fdef, mtable)
if (length(methods) == 1L)
return(methods[[1L]])
else if (length(methods) == 0L) {
cnames <- paste0("\"", sapply(classes, as.character),
"\"", collapse = ", ")
stop(gettextf("unable to find an inherited method for function %s for signature %s",
sQuote(fdef@generic), sQuote(cnames)), domain = NA)
}
else stop("Internal error in finding inherited methods; didn't return a unique method",
domain = NA)
})(list("numeric"), function (obj, ...)
standardGeneric("coordinates"), <environment>)
1: coordinates(c(1, 1, 2, 4))
Mostly I don't know why coordinates() won't work post-update. Any insight with that, as well as possibly a translation of the traceback would be a huge help. Thank you!