Re: [R] warning on generic function when building R package

2015-10-27 Thread Duncan Murdoch
On 27/10/2015 3:52 PM, David Stevens wrote: > Sorry to be a late comer to this problem but I'm having a similar > issue. My function is called by ode from deSolve > > ADM1_C <- function(t,state,parameters,...){ > > with(as.list(c(state,parameters)), { ># do some stuff here and return a list

Re: [R] warning on generic function when building R package

2015-10-27 Thread David Stevens
Sorry to be a late comer to this problem but I'm having a similar issue. My function is called by ode from deSolve ADM1_C <- function(t,state,parameters,...){ with(as.list(c(state,parameters)), { # do some stuff here and return a list containing a vector of derivatives to ode ... }) } in w

Re: [R] warning on generic function when building R package

2015-10-20 Thread carol white via R-help
Jim's solution works. Thank you Carol On Monday, October 19, 2015 11:53 PM, Jim Lemon wrote: I think what you may have done is simply changed x.init= to x=x.init. x.init may or may not be there when the function is called, and that is what the warning is saying. While you have sa

Re: [R] warning on generic function when building R package

2015-10-19 Thread Bert Gunter
What is the class attribute of your (misnamed) x.pt argument? If it does not inherit from class "func" then your plot.func method will not be used when you call plot(). You would need to explicitly call plot.func() instead. If this question/comment makes no sense to you, then you have some serious

Re: [R] warning on generic function when building R package

2015-10-19 Thread Jim Lemon
I think what you may have done is simply changed x.init= to x=x.init. x.init may or may not be there when the function is called, and that is what the warning is saying. While you have satisfied the restriction that the first argument must be "x", but then set the default value to something that R

Re: [R] warning on generic function when building R package

2015-10-19 Thread carol white via R-help
In effect, this works but whether I use x or x.init, y or y.init in plot.func, I get no visible binding for global variable ‘x.init’no visible binding for global variable ‘y.init’ Regards, On Monday, October 19, 2015 9:59 PM, Duncan Murdoch wrote: On 19/10/2015 3:50 PM, carol white

Re: [R] warning on generic function when building R package

2015-10-19 Thread Duncan Murdoch
On 19/10/2015 3:50 PM, carol white wrote: > Thanks Murdoch. > > defining > plot.func<- function(x=x.init, y=y.init, arg3, arg4, "title", col, arg5) > > and if plot doesn't take the exact parameters of plot.func but modified > of these parameters > plot(x=x.pt,y=y.pt,xlim = c(0, 10), ylim = c(0,1)

Re: [R] warning on generic function when building R package

2015-10-19 Thread carol white via R-help
Thanks Murdoch. defining plot.func<- function(x=x.init, y=y.init, arg3, arg4, "title", col, arg5) and if plot doesn't take the exact parameters of plot.func but modified of these parametersplot(x=x.pt,y=y.pt,xlim = c(0, 10), ylim = c(0,1), xlab= "xlab", ylab="ylab", main = "title", col = col,type

Re: [R] warning on generic function when building R package

2015-10-19 Thread Bert Gunter
... (Following up on Duncan) and see also ?plot and ?plot.default for argument details. Bert On Monday, October 19, 2015, Duncan Murdoch wrote: > On 19/10/2015 1:29 PM, carol white via R-help wrote: > > Hi,I have invoked plot in a function (plot.func) as follows but when I > check the built pac

Re: [R] warning on generic function when building R package

2015-10-19 Thread Duncan Murdoch
On 19/10/2015 1:29 PM, carol white via R-help wrote: > Hi,I have invoked plot in a function (plot.func) as follows but when I check > the built package, I get a warning: > plot(x.pt,y.pt,xlim = c(0, 10), ylim = c(0,1), xlab= "xlab", ylab="ylab", > main = "title", col = col,type = "l") > R CMD ch

Re: [R] warning on generic function when building R package

2015-10-19 Thread Jeff Newmiller
I would guess that x.pt does not have class "func", whatever that is. You really ought to read the manual section indicated in the error. --- Jeff NewmillerThe . . Go Live... DCN:

Re: [R] warning on generic function when building R package

2015-10-19 Thread Bert Gunter
Have you read the manual as requested? It will answer your question. Bert On Oct 19, 2015 6:31 PM, "carol white via R-help" wrote: > Hi,I have invoked plot in a function (plot.func) as follows but when I > check the built package, I get a warning: > plot(x.pt,y.pt,xlim = c(0, 10), ylim = c(0,1),