Dear BHM,
Sure, of course.
Basically, I executed the following sequence when the new packages is loaded:
-----------------------------------------------------------------
#define a list of the names of all the internals that I need.
.internals <- c(".all_aesthetics", "set_last_plot", "coord_transform.cartesian", "train_cartesian", "scales_add_missing", "ggname", "new_panel", "train_layout", "map_layout", "map_position", "new_panel", "train_position","Stat","GeomPath","add_group","scales_transform_df","reset_scales","scales_train_df","scales_map_df","order_groups","TopLevel", "compute_intercept", "combine_elements","is.rel", "facet_render", "coord_labels", "xlabel", "ylabel", "element_render", "build_guides", "is.zero", "plot_clone", "set_last_plot", "add_theme", "make_labels", "update_guides", "zeroGrob", "el_def")
.internals <- unique(.internals) #just in case
#load from the ggplot2 namespace
ggint <- structure(
mapply(function(.internals, i) getFromNamespace(i,"ggplot2"),.internals, .internals),
class=c("internal")
)
-----------------------------------------------------------------
This creates a structure (ggint), containing duplicates of all internal functions/objects (as they appear in ggplot2), so, where I initially needed to call ggplot2:::<xyz> (and which was subsequently raising red-flags with CRAN), I can now call with ggint$<xyz>(...).
I ended up absolutely NOT being able to use assignInNamespace(...) in any way whatsoever, which is why I needed to bring so many of these internal functions forward, and, most of the above, were needed to successfully create a new theme_get() and theme_set() routines to address my need for new theme elements and heirarchies that were originally not defined in ggplot2.
Given the previous statement, any function that I initially wanted to patch (and made effective via assignInNamespace(...)), I needed to make a copy (including the desired patches) in the ggtern namespace, and this created a cascading effect in that any function which used the newly patched function in the ggplot2 namespace, also needed to be duplicated in the ggtern namespace, however, any time an internal object/function was used, it needed to be replaced by ggint$<xyz>, which is why the .internals list above is so lengthy.
Anyway, Hope this helps.
Regards,
Nick Hamilton.