Skip to content

How to Develop

Kei Saito edited this page May 21, 2016 · 4 revisions

Setup

Install required R packages

You need following packages before starting development.

  • roxygen2
  • devtools
  • testthat
> install.packages(c("roxygen2", "devtools", "testthat"))
> library("roxygen2")
> library("devtools")
> library("testthat")

Clone repository

$ git clone [email protected]:exploratory-io/exploratory_func.git

Build and Deployment

Build package

1). Open Exploratory, go [Tools] -> [Diagnostics] -> [Run Diagnostics] and open diagnostics.txt.

image

2). Find the exploratory package version under "other attached packages:" section. In following exmaple, it is 0.1.4.

image

3). Open DESCRIPTION file and update Version to match with the version we found above in step #2.

Package: exploratory
Type: Package
Title: R package for Exploratory
Version: 0.1.4
Date: 2016-05-13

4). On R, set the current working dir to the checked out repository.

setwd("/Users/kei/Documents/gitrepos/exploratory_func")

5). Run build command.

> devtools::build(binary=TRUE)
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL  \
  '/Users/kei/Documents/gitrepos/exploratory_func' --build 

* installing to library/private/var/folders/nb/q827tn_966q2vftg10kz89gr0000gp/T/RtmpSlWK1Q/temp_libpath48991c1fb118* installing *source* packageexploratory...
** R
** preparing package for lazy loading
** help
No man pages found in packageexploratory*** installing help indices
** building package indices
** testing if installed package can be loaded
* creating tarball
packaged installation ofexploratoryasexploratory_0.1.4.tgz* DONE (exploratory)
[1] "/Users/kei/Documents/gitrepos/exploratory_0.1.4.tgz"

Deploy package to Exploratory

  1. Start R console and set the Exploratory Desktop's library folder ([your home directory]/.exploratory/R/[R version]) to '.libPaths' like below.
> .libPaths("~/.exploratory/R/3.3")

2). Call install.packages with the package tgz file created in the build step above.

> install.packages("../exploratory_0.1.4.tgz", repos = NULL, type="source")
Installing package into/Users/kei/.exploratory/R/3.3’
(aslibis unspecified)
* installing *binary* packageexploratory...
* DONE (exploratory)

3). Restart Exploratory and your change will be available on Exploratory.