An open API service indexing awesome lists of open source software.

https://github.com/brownag/soilprofilegraphs

Calibrated soil pit photos and plots with ggplot2
https://github.com/brownag/soilprofilegraphs

Last synced: 2 months ago
JSON representation

Calibrated soil pit photos and plots with ggplot2

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
dev = 'jpeg'
)
```

# SoilProfileGraphs

[![R-CMD-check](https://github.com/brownag/SoilProfileGraphs/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/brownag/SoilProfileGraphs/actions/workflows/R-CMD-check.yaml)

The goal of SoilProfileGraphs is to provide extensions for 'aqp' and 'ggplot2' for creation of soil profile-related graphics. The first focus is on 'calibrated' pit photographs with overplotting of soil property data.

## Installation

You can install the development version of SoilProfileGraphs like so:

``` r
# install.packages("remotes")
remotes::install_github("brownag/SoilProfileGraphs")
```

## Example

This is a basic example which shows you how to solve a common problem:

```{r example-sueredo}
library(SoilProfileGraphs)
library(soilDB)

spc <- readRDS(system.file("extdata", "aecpedons.rds",
package = "SoilProfileGraphs"))[4, ]
lab <- soilDB::fetchLDM(spc$pedlabsampnum)

spg(
lab,
system.file("extdata", "sueredo.png",
package = "SoilProfileGraphs"),
prop = "sand_total",
depth_min = -3,
depth_max = 185,
no_data_value = 76.5,
prop_min = 65,
prop_max = 95
)
```

```{r example-buttelake}
spc <- readRDS(system.file("extdata", "aecpedons.rds",
package = "SoilProfileGraphs"))[3, ]
lab <- soilDB::fetchLDM(spc$pedlabsampnum)

spg(
lab,
system.file("extdata", "buttelake.png",
package = "SoilProfileGraphs"),
prop = "sand_total",
depth_min = -3,
depth_max = 165,
no_data_value = 76.5,
prop_min = 50,
prop_max = 100
)
```