Setting default palette in .Rprofile

102 views
Skip to first unread message

Chris Neff

unread,
Oct 27, 2011, 6:56:14 AM10/27/11
to ggplot2
Hi all,

I really like ggplot2 but I prefer other defaults, especially the
RColorBrewer palettes for certain things. I tried to add the following
to my .Rprofile in order to change those defaults:

set_default_scale("color", "discrete", "brewer", palette="Paired")

However, when starting up R I get this error:

Error in set_default_scale("color", "discrete", "brewer", palette =
"Paired") :
could not find function "assignInNamespace"


Note that I can do it after everything has loaded and it works just
fine, but I would like it to automatically take effect when starting
R. Any ideas?

Kohske Takahashi

unread,
Oct 27, 2011, 8:17:47 AM10/27/11
to Chris Neff, ggplot2
Hi

probably this is because you call assignInNamespace while package:util
is not loaded.

maybe this can be workaround:

setHook(packageEvent("ggplot2", "onLoad"), function()
set_default_scale("color", "discrete", "brewer", palette="Paired"))

--
Kohske Takahashi <takahash...@gmail.com>

Research Center for Advanced Science and Technology,
The University of  Tokyo, Japan.
http://www.fennel.rcast.u-tokyo.ac.jp/profilee_ktakahashi.html

> --
> You received this message because you are subscribed to the ggplot2 mailing list.
> Please provide a reproducible example: http://gist.github.com/270442
>
> 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