Skip to content

Instantly share code, notes, and snippets.

@Nicktz
Created October 29, 2015 10:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nicktz/147d23fe6eb43874c44f to your computer and use it in GitHub Desktop.
Save Nicktz/147d23fe6eb43874c44f to your computer and use it in GitHub Desktop.
Installing plotly - Fairtreegists
Following [this](https://plot.ly/r/getting-started/) howto, go [here](https://plot.ly/) and sign up using github.
Once this has been done, take not of your username (same as github) and api key.
Then go to R and use the following code.
install.packages("viridis") # dependency
install.packages("devtools")
devtools::install_github("ropensci/plotly")
library(plotly)
Sys.setenv("plotly_username"="<<githubusername generated above>>")
Sys.setenv("plotly_api_key"="<<<apikeygenerated above>>>")
Now verify that you have successfully linked R to plotly:
plotly:::verify("username")
plotly:::verify("api_key")
@Nicktz
Copy link
Author

Nicktz commented Dec 17, 2015

To enable plotly at each opening of R, open Rprofile.site in this directory: C:\Program Files\R\R-3.2.2\etc.

Then, according to this link: http://www.statmethods.net/interface/customizing.html

Input:

.First <- function(){
library(fairtreeR)
load.packages()
library(plotly)
Sys.setenv("plotly_username"="Nicktz")
Sys.setenv("plotly_api_key"="a2gfekub28")
cat("\nWelcome at", date(), "\n")
}

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