Developmental Version of ggplot2 package?

8 views
Skip to first unread message

Jason Rupert

unread,
Mar 27, 2009, 10:49:26 AM3/27/09
to ggp...@googlegroups.com

What steps do I take to install the developmental version of the ggplot2 package?

I assume it involves:
install.package("ggplot2")
But, do I need to point to a different location inorder to get the developmental version?

Thank you again for all the feedback and insights.



JiHO

unread,
Mar 27, 2009, 12:01:53 PM3/27/09
to jasonk...@yahoo.com, ggp...@googlegroups.com
On 2009-March-27 , at 10:49 , Jason Rupert wrote:

> What steps do I take to install the developmental version of the
> ggplot2 package?
>
> I assume it involves:
> install.package("ggplot2")
> But, do I need to point to a different location inorder to get the
> developmental version?

You need to download the latest code from:

http://github.com/hadley/ggplot2/tree/master

If you do not have git installed you need to download the whole thing
using the download button and save that to a directory named ggplot2.
Otherwise:

git clone git://github.com/hadley/ggplot2.git

Then, from the parent of this directory, issue the command:

R CMD INSTALL ggplot2

that's on a unix kind of system. On windows I guess you can do
something with the command prompt but I am not sure how it works.

JiHO
---
http://jo.irisson.free.fr/

baptiste auguie

unread,
Mar 27, 2009, 12:11:32 PM3/27/09
to ggp...@googlegroups.com
just a thought: r-forge provides an experimental feature to build
packages hosted on another website. If Hadley is interested, that
would make the dev version more readily available (but that may not be
desirable for the dev version, i don't know).
--

_____________________________

Baptiste Auguié

School of Physics
University of Exeter
Stocker Road,
Exeter, Devon,
EX4 4QL, UK

Phone: +44 1392 264187

http://newton.ex.ac.uk/research/emag
______________________________

Felipe Carrillo

unread,
Mar 27, 2009, 3:10:18 PM3/27/09
to jasonk...@yahoo.com, ggp...@googlegroups.com, JiHO

Does anyone know how to download the ggplot2 developmental version using windows? I tried what JiHO is suggesting but got lost.

Felipe D. Carrillo
Supervisory Fishery Biologist
Department of the Interior
US Fish & Wildlife Service
California, USA


--- On Fri, 3/27/09, JiHO <jo.l...@gmail.com> wrote:

Jason Rupert

unread,
Mar 27, 2009, 5:42:59 PM3/27/09
to ggp...@googlegroups.com, JiHO, mazatla...@yahoo.com

I would also be interested in the steps for installing the developmental version on a Windows machine.

Thanks a bunch for any hints or tips.


--- On Fri, 3/27/09, Felipe Carrillo <mazatla...@yahoo.com> wrote:

JiHO

unread,
Mar 28, 2009, 12:41:31 AM3/28/09
to jasonk...@yahoo.com, ggp...@googlegroups.com, mazatla...@yahoo.com
On 2009-March-27 , at 17:42 , Jason Rupert wrote:

> I would also be interested in the steps for installing the
> developmental version on a Windows machine.
>
> Thanks a bunch for any hints or tips.


The download should not be a problem. Just go there:

http://github.com/hadley/ggplot2/tree/master

and there is a download button at the top. Then you end up with a
folder named ggplot2. This is the source of the package ggplot, so you
need to compile it. Hadley will correct me if I am wrong but I think
ggplot is written in plain R only, so you won't need anything else to
install it from source. The manual regarding installing from source on
windows is there:

http://cran.r-project.org/doc/manuals/R-admin.html#Windows-packages

It seems that 'R CMD install' is still the way to go, but for that you
must know how to use the command prompt. And, regarding that, I cannot
help you more. If many "non technical" people (no offense intended,
there is nothing wrong with not wanting to know about git or the
command prompt) are interested in getting the devel version, then
maybe having ggplot2 on r-forge would be the way to go. It would also
mean that a new release is needed but I am pretty sure Hadley has one
just around the corner.

Cheers,

JiHO
---
http://jo.irisson.free.fr/

Jason Rupert

unread,
Mar 28, 2009, 9:07:10 AM3/28/09
to JiHO, ggp...@googlegroups.com, mazatla...@yahoo.com

JiHO,

Thanks for posting the link to the manual regarding installing from source on windows is there:
http://cran.r-project.org/doc/manuals/R-admin.html#Windows-packages

Evidently I am in a position where I have limits on what I can install on my network. I am able to install packages, but have strong limits on all other items, so this would not allow me to go through the "The Windows toolset" approach.

I am however able to build packages on an external Unix machine and then use the packages. I guess that means I need to follow the instructions listed at the following site?
http://win-builder.r-project.org/

I guess that will allow me to build a Windows package from Unix. Does that sound like the right path? Also, I don't mind getting my hands dirty working from the terminal. I'm just trying to get my hands around the "R" way of doing things.

Thanks again.






--- On Fri, 3/27/09, JiHO <jo.l...@gmail.com> wrote:

> From: JiHO <jo.l...@gmail.com>
> Subject: Re: Developmental Version of ggplot2 package?
> To: jasonk...@yahoo.com

Karl Ove Hufthammer

unread,
Mar 28, 2009, 1:31:31 PM3/28/09
to ggp...@googlegroups.com
JiHO skreiv:

> You need to download the latest code from:
>
> http://github.com/hadley/ggplot2/tree/master
>
> If you do not have git installed you need to download the whole thing
> using the download button and save that to a directory named ggplot2.
> Otherwise:
>
> git clone git://github.com/hadley/ggplot2.git
>
> Then, from the parent of this directory, issue the command:
>
> R CMD INSTALL ggplot2
>

I’m on a Linux system, and this seems to work, when but I start R and
run library(ggplot2), I get the following error message:

$ library(ggplot2)
Loading required package: proto
Loading required package: grid
Loading required package: reshape
Loading required package: plyr
Error in proto(ScaleContinuous, expr = { :
object 'ScaleContinuous' not found
Error : unable to load R code in package 'ggplot2'
Error: package/namespace load failed for 'ggplot2'

Any ideas why?

--
Karl Ove Hufthammer

baptiste auguie

unread,
Mar 28, 2009, 2:01:53 PM3/28/09
to Karl Ove Hufthammer, ggp...@googlegroups.com
Hadley suggested the following to me a while back,

"just source("load.r") and it will load in all of the other R files. "

I'm not sure if that works on windows though.

baptiste

Karl Ove Hufthammer

unread,
Mar 28, 2009, 2:08:15 PM3/28/09
to ggp...@googlegroups.com
baptiste auguie skreiv:

> Hadley suggested the following to me a while back,
>
> "just source("load.r") and it will load in all of the other R files. "
>

This tries to load the file ‘~/documents/ggplot/ggplot/data/mpg.rda’, which naturally doesn’t exist. Easy enough to fix with a symlink, though. But ggplot2 still doesn’t seem to work properly:

$ example(qplot)

qplot$ # Use data from data.frame
qplot$ qplot(mpg, wt, data=mtcars)
Hit <Return> to see next plot:
Error in get("train_df", env = .$scales$x[[i]], inherits = TRUE)(.$scales$x[[i]], :
unused argument(s) (drop = FALSE)


--
Karl Ove Hufthammer

Karl Ove Hufthammer

unread,
Mar 28, 2009, 2:12:39 PM3/28/09
to ggp...@googlegroups.com
Karl Ove Hufthammer skreiv:

> This tries to load the file ‘~/documents/ggplot/ggplot/data/mpg.rda’, which naturally doesn’t exist. Easy enough to fix with a symlink, though. But ggplot2 still doesn’t seem to work properly:
>
> Error in get("train_df", env = .$scales$x[[i]], inherits = TRUE)(.$scales$x[[i]], :
> unused argument(s) (drop = FALSE)
>

Note that that was with the old (non-developmental version) of ggplot2
installed. I first tried it with no version installed, but then load.r
objected. With the development version installed, I get the same error
message as before:

$ source("load.r")


Error in proto(ScaleContinuous, expr = { :
object 'ScaleContinuous' not found
Error : unable to load R code in package 'ggplot2'
Error: package/namespace load failed for 'ggplot2'

--
Karl Ove Hufthammer

Karl Ove Hufthammer

unread,
Mar 28, 2009, 2:32:53 PM3/28/09
to ggp...@googlegroups.com
Karl Ove Hufthammer skreiv:

> Note that that was with the old (non-developmental version) of ggplot2
> installed. I first tried it with no version installed, but then load.r
> objected. With the development version installed, I get the same error
> message as before:
>

Solved it. It turned out that the code depends on the various R files
being loaded in a specific order. For example, scale-.r needs to be
loaded before scale-continuous-.r, and I guess that’s the reason for the
somewhat strange name (with a trailing hyphen).

But ordering of file names are *highly* locale dependent, and for my
locale (nn_NO.UTF-8), scale-.r is *not* sorted before the other files.

Changing the locale to C, everything worked fine. But this is obviously
not an ideal solution!

--
Karl Ove Hufthammer

Jason Rupert

unread,
Mar 28, 2009, 3:14:15 PM3/28/09
to ggp...@googlegroups.com, Karl Ove Hufthammer


By any chance can you share which OS were you using during all of this?

Thanks.




--- On Sat, 3/28/09, Karl Ove Hufthammer <Karl.Hu...@math.uib.no> wrote:

> From: Karl Ove Hufthammer <Karl.Hu...@math.uib.no>
> Subject: Re: Developmental Version of ggplot2 package?

Karl Ove Hufthammer

unread,
Mar 28, 2009, 3:15:58 PM3/28/09
to ggp...@googlegroups.com
Jason Rupert skreiv:

> By any chance can you share which OS were you using during all of this?

As I mentioned in my first post, I use Linux.

--
Karl Ove Hufthammer

hadley wickham

unread,
Mar 28, 2009, 5:12:59 PM3/28/09
to Karl Ove Hufthammer, ggp...@googlegroups.com
On Sat, Mar 28, 2009 at 1:32 PM, Karl Ove Hufthammer
<Karl.Hu...@math.uib.no> wrote:
>
> Karl Ove Hufthammer skreiv:
>> Note that that was with the old (non-developmental version) of ggplot2
>> installed. I first tried it with no version installed, but then load.r
>> objected. With the development version installed, I get the same error
>> message as before:
>>
>
> Solved it. It turned out that the code depends on the various R files
> being loaded in a specific order. For example, scale-.r needs to be
> loaded before scale-continuous-.r, and I guess that’s the reason for the
> somewhat strange name (with a trailing hyphen).
>
> But ordering of file names are *highly* locale dependent, and for my
> locale (nn_NO.UTF-8), scale-.r is *not* sorted before the other files.

Yes, this is a big pain when using proto. I should be able to solve
the problem by manually specifying a collation order in the
DESCRIPTION file (and for source.r), but then I need to make sure that
the list is kept up to date somehow. This has never been much of a
priority when it was just me interested in the development version,
but I do need to think about it more now that more people are
interested. Any suggestions would be gratefully received.

Hadley

--
http://had.co.nz/

Kasper Daniel Hansen

unread,
Mar 28, 2009, 5:26:53 PM3/28/09
to hadley wickham, Karl Ove Hufthammer, ggp...@googlegroups.com
I would add in a COLLATE field. As far as I remember, R CMD check does
complain if you for example have a file in /R that is not mentioned in
collate. In my experience, I have not had problems keeping the collate
field up to date.

Kasper

hadley wickham

unread,
Mar 28, 2009, 8:58:38 PM3/28/09
to Karl Ove Hufthammer, ggp...@googlegroups.com
On Sat, Mar 28, 2009 at 1:32 PM, Karl Ove Hufthammer
<Karl.Hu...@math.uib.no> wrote:
>
> Karl Ove Hufthammer skreiv:
>> Note that that was with the old (non-developmental version) of ggplot2
>> installed. I first tried it with no version installed, but then load.r
>> objected. With the development version installed, I get the same error
>> message as before:
>>
>
> Solved it. It turned out that the code depends on the various R files
> being loaded in a specific order. For example, scale-.r needs to be
> loaded before scale-continuous-.r, and I guess that’s the reason for the
> somewhat strange name (with a trailing hyphen).

Can you please try with the load.r that I've just uploaded? It should
automatically find the source files relative to load.r, and it
switches to my locale to make sure they get ordered in the correct
way.

Hadley

--
http://had.co.nz/

hadley wickham

unread,
Mar 28, 2009, 9:02:29 PM3/28/09
to Kasper Daniel Hansen, Karl Ove Hufthammer, ggp...@googlegroups.com
Do I really need a COLLATE field? The manual says:

"An optional ‘Collate’ field (or OS-specific variants
‘Collate.OStype’, such as e.g. ‘Collate.windows’) can be used for
controlling the collation order for the R code files in a package when
these are concatenated into a single file upon installation from
source. The default is to try collating according to the ‘C’ locale."

Can anyone confirm that R CMD install does currently not work for them
because of this problem?

Hadley
--
http://had.co.nz/

Kasper Daniel Hansen

unread,
Mar 28, 2009, 9:23:54 PM3/28/09
to hadley wickham, Karl Ove Hufthammer, ggp...@googlegroups.com
If your files need to be sourced in a specific order, you do need
COLLATE. This is for example the case for all packages using the S4
system.

Kasper

hadley wickham

unread,
Mar 28, 2009, 9:31:27 PM3/28/09
to Kasper Daniel Hansen, Karl Ove Hufthammer, ggp...@googlegroups.com
Ok - I've just pushed a version to github that does use collate. I
also discovered I had a bug in my file ordering which was causing some
problems. Hopefully that should be fixed now too.

Hadley

On Sat, Mar 28, 2009 at 8:23 PM, Kasper Daniel Hansen
--
http://had.co.nz/

Karl Ove Hufthammer

unread,
Mar 30, 2009, 7:30:15 AM3/30/09
to hadley wickham, ggp...@googlegroups.com
hadley wickham skreiv:

> Can you please try with the load.r that I've just uploaded? It should
> automatically find the source files relative to load.r, and it
> switches to my locale to make sure they get ordered in the correct
> way.
>

I now get this error message:
$ source("load.r")
Error in dirname(FILE) : a character vector argument expected

--
Karl Ove Hufthammer

Reply all
Reply to author
Forward
0 new messages