Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
abuseki committed Mar 9, 2024
1 parent 499c0ee commit 1a77e4b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 83 deletions.
106 changes: 34 additions & 72 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -1,93 +1,55 @@
---
output: github_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, message = FALSE)

<!-- README.md is generated from README.Rmd. Please edit that file -->

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# georefdatar -- Geosciences Reference Datasets in R

# georefdatar

<!-- badges: start -->
[![R-CMD-check](https://github.com/abuseki/georefdatar/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/abuseki/georefdatar/actions/workflows/R-CMD-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/georefdatar)](https://CRAN.R-project.org/package=georefdatar)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://choosealicense.com/licenses/mit/)
[![Test coverage](https://github.com/abuseki/georefdatar/actions/workflows/test-coverage.yaml/badge.svg)](https://github.com/abuseki/georefdatar/actions/workflows/test-coverage.yaml)
<!-- badges: end -->

The goal of georefdatar is to provide regularly used reference data sets for
geoscience for use with _R_.
The goal of georefdatar is to ...

Up to now these are:
## Installation

* periodic table of the elements
* standard atomic weights of the elements, as recommended by [IUPAC](https://iupac.org)
* table of minerals -- with name, symbol (abbreviation) and chemistry
* well known and widely used geochemical data of reservoirs like the primitive
mantle, the continental crust, basalts, ...
* tables of decay constants and isotopic rations frequently used in
geochronology
* color codes of the [International Chronostratigraphic Chart](https://stratigraphy.org/chart)
* Sets of elements regularly used in geochemistry, e. g. REE, HREE, PGE, ...
* some functions for basic queries of the periodic table of the elements and the
list of minerals are also included.
You can install the development version of georefdatar from [GitHub](https://github.com/) with:

All datasets are fully referenced, and a BibTeX file containing the references is included.
``` r
# install.packages("devtools")
devtools::install_github("abuseki/georefdatar")
```

## Installation
## Example

You can install the version from [CRAN](https://cran.r-project.org/) with:
This is a basic example which shows you how to solve a common problem:

``` r
install.packages("georefdatar")
```{r example}
library(georefdatar)
## basic example code
```

Or you can install the development version from [GitHub](https://github.com/) with:
What is special about using `README.Rmd` instead of just `README.md`? You can include R chunks like so:

``` r
# install.packages("devtools")
devtools::install_github("abuseki/georefdatar")
```{r cars}
summary(cars)
```

## Example
You'll still need to render `README.Rmd` regularly, to keep `README.md` up-to-date. `devtools::build_readme()` is handy for this.

You can also embed plots, for example:

```{r pressure, echo = FALSE}
plot(pressure)
```

* To get the classic primitive mantle data of Sun and McDounough (1989) one can use:

```{r}
library(georefdatar)
PM__Sun_McDounough__1989[,c('Cs','Rb','Ba','Th','U','Nb','K','La','Ce','Pb','Pr','Sr','P','Nd','Zr','Sm','Eu','Ti','Dy','Y','Yb','Lu')]
```

or using `dplyr`:
```{r}
library(georefdatar)
library(dplyr)
PM__Sun_McDounough__1989 %>% select(Cs, Rb, Ba, Th, U, Nb, K, La, Ce, Pb, Pr, Sr, P, Nd, Zr, Sm, Eu, Ti, Dy, Y, Yb, Lu)
```

* Query the list of minerals:
* by names or symbols given as a regular expression:
```{r}
library(georefdatar)
minSearch('Pyrr.*')
minSearch('^Ms$')
```

* by chemistry as a regular expression:
```{r}
library(georefdatar)
minsForChemistry('\\(SiO4\\)3$')
```

* Query atomic mass from the periodic table of the elements:
```{r}
aw('H')
aw('H')*2 + aw('O')
# Si wt% in muscovite
round(3*aw('Si') / (aw('K')+3*aw('Al')+3*aw('Si')+12*aw('O')+2*aw('H')) * 100, 2)
```

In that case, don't forget to commit and push the resulting figure files, so they display on GitHub and CRAN.
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,29 @@
# georefdatar – Geosciences Reference Datasets in R

<!-- badges: start -->

[![R-CMD-check](https://github.com/abuseki/georefdatar/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/abuseki/georefdatar/actions/workflows/R-CMD-check.yaml)
[![CRAN
status](https://www.r-pkg.org/badges/version/georefdatar)](https://CRAN.R-project.org/package=georefdatar)
[![CRAN status](https://www.r-pkg.org/badges/version/georefdatar)](https://CRAN.R-project.org/package=georefdatar)
![development version number](https://img.shields.io/github/r-package/v/abuseki/georefdatar)
[![License:
MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://choosealicense.com/licenses/mit/)
[![Test
coverage](https://github.com/abuseki/georefdatar/actions/workflows/test-coverage.yaml/badge.svg)](https://github.com/abuseki/georefdatar/actions/workflows/test-coverage.yaml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://choosealicense.com/licenses/mit/)
[![Test coverage](https://github.com/abuseki/georefdatar/actions/workflows/test-coverage.yaml/badge.svg)](https://github.com/abuseki/georefdatar/actions/workflows/test-coverage.yaml)
<!-- badges: end -->

The goal of georefdatar is to provide regularly used reference data sets
> The goal of georefdatar is to provide regularly used reference data sets
for geoscience for use with *R*.

Up to now these are:

- periodic table of the elements
- standard atomic weights of the elements, as recommended by
[IUPAC](https://iupac.org)
- table of minerals – with name, symbol (abbreviation) and chemistry
- table of minerals – with name, symbol (abbreviation) and formula
- well known and widely used geochemical data of reservoirs like the
primitive mantle, the continental crust, basalts, …
- tables of decay constants and isotopic rations frequently used in
geochronology
- color codes of the [International Chronostratigraphic
Chart](https://stratigraphy.org/chart)
- Sets of elements regularly used in geochemistry, e. g. REE, HREE, PGE,
- sets of elements regularly used in geochemistry, e. g. REE, HREE, PGE, ...
- some functions for basic queries of the periodic table of the elements
and the list of minerals are also included.

Expand Down

0 comments on commit 1a77e4b

Please sign in to comment.