Permanently hacking ggplot2

21 views
Skip to first unread message

Thomas

unread,
Apr 17, 2012, 2:13:07 PM4/17/12
to ggplot2
Hi everyone

As part of another thread in this group:

http://groups.google.com/group/ggplot2/browse_thread/thread/d5e6500e273f8191/1a307ffedca6f7b2?lnk=gst&q=facet+dimension#1a307ffedca6f7b2

I have devised a hack in the facetting functionality of ggplot2. Now I
have another problem which I think warrants its own thread.

How do you alter code in the ggplot2 package permanently? If I repack
from source it complains about the MD5 checksums not corresponding
(naturally), but besides this I would like to do it from within the R
console.

assignInNamespace does not seem to permanently affect the package and
does also throw an error when used with facet_panels.grid:

> assignInNamespace('facet_panels.grid', facet_panels.grid, ns='ggplot2')
Error in get(S3[i, 1L], mode = "function", envir = parent.frame()) :
object 'facet_panels' of mode 'function' was not found

(This error does not occur when assigning facet_grid.

Best Wishes

Thomas

Thomas

unread,
Apr 17, 2012, 2:14:17 PM4/17/12
to ggplot2
I do realize that this question is perhaps more related to R itself
than ggplot2, but I hope you will bear with me...

On Apr 17, 8:13 pm, Thomas <thomas...@gmail.com> wrote:
> Hi everyone
>
> As part of another thread in this group:
>
> http://groups.google.com/group/ggplot2/browse_thread/thread/d5e6500e2...

Ista Zahn

unread,
Apr 17, 2012, 2:20:26 PM4/17/12
to Thomas, ggplot2
Hi Thomas,

If I were you I would try to get this into the main version rather
than forking and hacking. If you go down that road you're going to
have to re-do this every time a new version is released (either that
or forgo future improvements from the main version).

That said, if you must fork, github makes it pretty easy. Just sign up
for a github account, fork and hack away. You can even use
install_github from devtools to install your hacked version directly
from github.

Best,
Ista

> --
> You received this message because you are subscribed to the ggplot2 mailing list.
> Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2

Reply all
Reply to author
Forward
0 new messages