greenplum-db / PivotalR-archive

An convenient R tool for manipulating tables in PostgreSQL type databases and a wrapper of Apache MADlib.
https://pivotalsoftware.github.io/gp-r/
125 stars 53 forks source link

conflict with mapproj??? #17

Closed mwillumz closed 10 years ago

mwillumz commented 10 years ago

I'm getting behavior I don't understand. When using ggplot2 package w/ mapproj dependencies (ggmap or coordinate_map functions) I'm getting odd errors.

This only occurs after PivotalR has been loaded and persists after

detach("package:PivotalR",unload=TRUE)

However, if I restart R and do above mapproj functions without PivotalR loaded the code executes correctly... I'm not sure how to reproduce other than suggesting to

  1. load PivotalR and generate dataset from preview()
  2. try the following
library(ggmap)
Map <- get_map()
ggmap(Map)

Should pull up a map of Houston if PivotalR is not invoked and error out if it has been...

(Just want to add that I think this PivotalR is wonderful and progressing nicely!)

walkingsparrow commented 10 years ago

I will look into this. And thank you for the praise.

walkingsparrow commented 10 years ago

The error comes from a conflict between print.ggplot and PivotalR, but normal ggplot figures can be plotted without a problem. This problem only happens with ggmap.

walkingsparrow commented 10 years ago

The root cause is "methods:::bind_activation(on = TRUE)" in the onAttach.R of PivotalR. Run "methods:::bind_activation(on = FALSE)", and ggmap will be fine again.

I use this to activate "cbind2" and make "cbind" work with db.obj objects (db.obj is S4 class). This method is explained in the manual for "cbind2" (see help(cbind2)). Apparently, this breaks ggmap.

It is not a good idea to use an internal function of another package, so I decide to remove "bind_activation" from the package, and use another workaround to make "cbind" work with db.obj objects.

walkingsparrow commented 10 years ago

Conflict with ggmap has been fixed. The fix is in master now.