R package for geochemical datasets
R package for geochemical datasets. This package reads and processes geochemical datasets, downloads CASTEML from Medusa, processes IONML, and plots typical geochemical datasets.
See manual at `https://dream.misasa.okayama-u.ac.jp/documentation/chelyabinsk-manual.pdf'. See shiny project -- VisualAnalysis that refers to this package.
To install this package issue following command.
R> install.packages('devtools')
R> devtools::install_github('misasa/chelyabinsk')
R> devtools::install_github('misasa/MedusaRClient')
R> library('chelyabinsk')
R> cbk.path("periodic-dflame0.csv")
Check a directory for packages ~/R/win-library/
when necessary.
When you see message such like below, try following.
Error in curl::curl_fetch_disk(url, x$path, handle = handle) : Problem with the SSL CA cert (path? access rights?
R> install.packages(c("curl", "httr"))
Examples to plot analyses related to a stone and its descendants are shown below. Issue following commands.
$ Rscript -e "chelyabinsk::cbk.plot(\"20130528105235-594267\", category=\"trace\")"
R> library(chelyabinsk)
R> pmlame <- cbk.read.casteml("20130528105235-594267")
R> cbk.plot.spider(pmlame,property="atomicnumber",reference="Wasson.1988")
Or write a Rscript with following lines.
#!/usr/bin/env Rscript
library(chelyabinsk)
rplotfile <- 'Rplots.pdf'; pdf(rplotfile)
cbk.plot("20130528105235-594267")
dev.off()
https://github.com/misasa/chelyabinsk
$ cd ~/devel-godigo
$ git clone https://github.com/misasa/chelyabinsk.git
R> install.packages('testthat')
R> install.packages("roxygen2")
Locate your script with a function to directory "R". Write document with rule of Roxygen2. Do not use |#' | in main code besides the documentation in Roxygen2.
Update version number in ./DESCRIPTION and generate Rdoc by following commands.
$ cd ~/devel-godigo/chelyabinsk
$ Rscript -e "devtools::document()"
R> setwd(path.expand("~/devel-godigo/chelyabinsk"))
R> devtools::document()
$ vi ./tests/testthat/test-mytest.R
$ R CMD check ../chelyabinsk
Copy manual automatically created by roxygen to https://dream.misasa.okayama-u.ac.jp/documentation/chelyabinsk-manual.pdf when necessary.
$ cp ./chelyabinsk.Rcheck/chelyabinsk-manual.pdf ~/devel-godigo/documentation/
$ R CMD build ../chelyabinsk
$ R CMD install chelyabinsk_1.0.tar.gz
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.