[R] Tidying up code - Warning message: deparse may be incomplete

Duncan Murdoch murdoch at stats.uwo.ca
Thu Aug 28 18:26:12 CEST 2008


On 28/08/2008 10:46 AM, Marie Pierre Sylvestre wrote:
> Dear R users,
> 
> I am currently writing a R package and to do so I am following the
> guidelines in manual 'Writing R extensions'.
> 
> In Section 3.1, it is suggested to tidy up the code using a file
> containing the following:
> options(keep.source = FALSE)
> source("myfuns..R")
> dump(ls(all = TRUE), file = new.myfuns.R")
> 
> I have done this for my own packages and although it runs, I get several
> warnings of the type:
> 
> Warning message:
> In dump(ls(all = TRUE), file = "PermAlgo.R") : deparse may be incomplete
> 
> I am clueless as to what this means.
> 
> Even if I try to tidy only one function from my code, I get the warning.
> 
> 
> E.g. the file lala.R contains only this:
> partialHazards <- function(t, v, covArray, betas){   exp( covArray[v,t,]
> %*% betas ) }
> 
> the file tidylala.R contains:
> 
> options(keep.source = FALSE)
> source("lala.R")
> dump(ls(all = TRUE), file = "newlala.R")
> 
> On Linux I run:
> 
> R --vanilla < tidylala.R      
> 
> Then I obtain:
> 
> Warning message:
> In dump(ls(all = TRUE), file = "newlala.R") : deparse may be incomplete
> 
> The file newlala.R looks like this:
> 
> `partialHazards` <-
> function (t, v, covArray, betas)
> {
>     exp(covArray[v, t, ] %*% betas)
> }
> 
> What does the warning mean? Can I simply ignore it?

The warning means that you may have lost some information, i.e. sourcing 
newlala.R won't produce the same thing as sourcing lala.R.  I think in 
your case, there's no loss, so it's a bug, but I don't have time to 
track down why you're getting it.

Duncan Murdoch



More information about the R-help mailing list