[Rd] Debugging namespace problems

2011-12-23 Thread Hadley Wickham
Hi all, I frequently find that I've failed to export something in my NAMESPACE and hence my package doesn't work when it's imported into another package. Does anyone have suggestion for debugging this type of problem? R CMD check passes without any ns related errors on both the importee and the

Re: [Rd] Debugging namespace problems

2011-12-23 Thread Hadley Wickham
I should add that I'm pretty sure this is something wrong with the ggplot2 NAMESPACE because if I explicitly attach ggplot2 the code works: library(nstest) my_plot() Error in UseMethod(scale_dimension) : no applicable method for 'scale_dimension' applied to an object of class NULL

Re: [Rd] Debugging namespace problems

2011-12-23 Thread Hadley Wickham
And one last note: I'm reasonably certain I haven't forgotten to export an S3 method because I wrote the following script to (crudely) compare the function definitions in ggplot2 with its namespace: ns - parseNamespaceFile(ggplot, ~/Documents/ggplot/) s3e - paste(ns$S3methods[, 1],

Re: [Rd] Debugging namespace problems

2011-12-23 Thread Martin Morgan
On 12/23/2011 11:54 AM, Hadley Wickham wrote: And one last note: I'm reasonably certain I haven't forgotten to export an S3 method because I wrote the following script to (crudely) compare the function definitions in ggplot2 with its namespace: ns- parseNamespaceFile(ggplot,

Re: [Rd] Debugging namespace problems

2011-12-23 Thread Martin Morgan
On 12/23/2011 02:11 PM, Martin Morgan wrote: On 12/23/2011 11:54 AM, Hadley Wickham wrote: And one last note: I'm reasonably certain I haven't forgotten to export an S3 method because I wrote the following script to (crudely) compare the function definitions in ggplot2 with its namespace: ns-

Re: [Rd] Debugging namespace problems

2011-12-23 Thread Hadley Wickham
in scales_add_defaults, where the symbol isn't found in the globalenv() when nstest is attached and ggplot2 only loaded, but is (via the search path) when ggplot2 is attached. and topenv(parent.frame()) is a replacement that gets to .GlobalEnv for ggplot2, and to the name space for nstest.

Re: [Rd] Debugging namespace problems

2011-12-23 Thread Martin Morgan
On 12/23/2011 02:38 PM, Hadley Wickham wrote: in scales_add_defaults, where the symbol isn't found in the globalenv() when nstest is attached and ggplot2 only loaded, but is (via the search path) when ggplot2 is attached. and topenv(parent.frame()) is a replacement that gets to .GlobalEnv for