Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
How to install development version of ggplot2
# install devtools
install.packages('devtools')
# install dependency of scales package
install.packages(c("RColorBrewer", "stringr", "dichromat", "munsell", "plyr", "colorspace"))
# load devtools
library(devtools)
# move to development mode
# scales and ggplot2 are installed in "~/R-dev" directory, so official version of ggplot2 are not removed.
dev_mode(TRUE)
install_github("scales")
# main branch of development
install_github("ggplot2", "hadley", "develop")
#install_github("ggplot2", "kohske", "feature/new-guides-with-gtable")
# load development version of ggplot2
library(ggplot2)
@ltjds

This comment has been minimized.

Show comment Hide comment
@ltjds

ltjds Jan 21, 2018

CORRECTION:

After loading this, I had a few errors, since some of the parameters in install_github are deprecated. This worked for me:

# install devtools
install.packages('devtools')

# install dependency of scales package
install.packages(c("RColorBrewer", "stringr", "dichromat", "munsell", "plyr", "colorspace"))

# Open devtools package
library(devtools)

# move to development mode
# scales and ggplot2 are installed in "~/R-dev" directory, so official version of ggplot2 are not removed.
dev_mode(TRUE)

install_github("hadley/scales", force=TRUE)
# main branch of development
install_github("hadley/ggplot2")
# (Optional) install_github("ggplot2", "kohske", "feature/new-guides-with-gtable")

# Exit dev mode
dev_mode(FALSE)

# load development version of ggplot2
library(ggplot2)

ltjds commented Jan 21, 2018

CORRECTION:

After loading this, I had a few errors, since some of the parameters in install_github are deprecated. This worked for me:

# install devtools
install.packages('devtools')

# install dependency of scales package
install.packages(c("RColorBrewer", "stringr", "dichromat", "munsell", "plyr", "colorspace"))

# Open devtools package
library(devtools)

# move to development mode
# scales and ggplot2 are installed in "~/R-dev" directory, so official version of ggplot2 are not removed.
dev_mode(TRUE)

install_github("hadley/scales", force=TRUE)
# main branch of development
install_github("hadley/ggplot2")
# (Optional) install_github("ggplot2", "kohske", "feature/new-guides-with-gtable")

# Exit dev mode
dev_mode(FALSE)

# load development version of ggplot2
library(ggplot2)
@raffacabofrio

This comment has been minimized.

Show comment Hide comment
@raffacabofrio

raffacabofrio Apr 26, 2018

Tried to folow ltjds script. Dont have errors. But dev ggplot2 is not being used.

Tried to folow ltjds script. Dont have errors. But dev ggplot2 is not being used.

@kesireddy007

This comment has been minimized.

Show comment Hide comment
@kesireddy007

kesireddy007 May 4, 2018

I am trying to install ggplot2 dev version to use ggplotly function, following ltjds code above. However, I get the following error, it succeeds till few steps like creating "~/R-dev" directory, installing scales and ggplot2 in that folder. However, at the testing if installed package can be loaded step, I get errors, as shown below.
Error : .onAttach failed in attachNamespace() for 'ggplot2', details:
call: NULL
error: 'with_preserve_seed' is not an exported object from 'namespace:withr'
Error: loading failed
Execution halted
ERROR: loading failed

  • removing 'C:/Users/venu_/Documents/R-dev/ggplot2'
    Installation failed: Command failed (1)
    So , only scales package now remains in ~/R-dev" directory. Unable to figure out , what needs to be done.
    Regular ggplot2 package in the R Directory works fine.

I am trying to install ggplot2 dev version to use ggplotly function, following ltjds code above. However, I get the following error, it succeeds till few steps like creating "~/R-dev" directory, installing scales and ggplot2 in that folder. However, at the testing if installed package can be loaded step, I get errors, as shown below.
Error : .onAttach failed in attachNamespace() for 'ggplot2', details:
call: NULL
error: 'with_preserve_seed' is not an exported object from 'namespace:withr'
Error: loading failed
Execution halted
ERROR: loading failed

  • removing 'C:/Users/venu_/Documents/R-dev/ggplot2'
    Installation failed: Command failed (1)
    So , only scales package now remains in ~/R-dev" directory. Unable to figure out , what needs to be done.
    Regular ggplot2 package in the R Directory works fine.
@kamingfung

This comment has been minimized.

Show comment Hide comment
@kamingfung

kamingfung May 8, 2018

@raffacabofrio
Having updated to R v3.5, I need to reinstall ggplot2 from the source.
I can now use the dev ggplot2 only when dev_mode=TRUE.
Maybe you can try again with dev_mode on.

kamingfung commented May 8, 2018

@raffacabofrio
Having updated to R v3.5, I need to reinstall ggplot2 from the source.
I can now use the dev ggplot2 only when dev_mode=TRUE.
Maybe you can try again with dev_mode on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment