soilReports
An R package that assists with the setup and operation of a collection of soil data summary, comparison, and evaluation reports.
https://github.com/ncss-tech/soilReports
Category: Natural Resources
Sub Category: Soil and Land
Keywords
nasis nrcs soil soil-survey usda
Keywords from Contributors
digital-soil-mapping pedology tabular-data shiny eda ncss pedometrics s4ss spatial-data
Last synced: about 22 hours ago
JSON representation
Repository metadata
An R package that assists with the setup and operation of a collection of soil data summary, comparison, and evaluation reports. These reports are primarily used by USDA-NRCS soil scientists in both initial and update mapping.
- Host: GitHub
- URL: https://github.com/ncss-tech/soilReports
- Owner: ncss-tech
- Created: 2016-08-05T19:34:16.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-04-11T15:00:22.000Z (16 days ago)
- Last Synced: 2025-04-19T14:49:23.605Z (8 days ago)
- Topics: nasis, nrcs, soil, soil-survey, usda
- Language: HTML
- Homepage:
- Size: 7.88 MB
- Stars: 16
- Watchers: 8
- Forks: 4
- Open Issues: 54
- Releases: 0
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
README.md
soilReports
Reports are a handy way to summarize large volumes of data, particularly with figures and tables. soilReports
is an R package "container" designed to accommodate the maintenance, documentation, and distribution of R-based reporting tools. Inside the package are report templates, setup files, documentation, and example configuration files.
The soilReports
package provides a couple important helper functions that do most of the work:
listReports()
: print a listing of the available reports, version numbers, and basic metadatareportSetup(...)
: download any R packages required by the named report, e.g. "southwest/mu-comparison"reportInit(...)
|reportCopy(...)
: copy a named report template into a specific directoryreportUpdate(...)
: update a named report in a specific directory, replacingreport.Rmd
only
Each report contains several files:
report.Rmd
: an R Markdown file that is "knit" into a final HTML or DOC reportREADME.md
: report-specific instructionscustom.R
: report-specific functionscategorical_definitions.R
: report-specific color mapping and metadata for categorical raster data (user-editable)config.R
: configuration file to set report parameters (user-editable)changes.txt
: notes on changes and associated version numbers
R Profile Setup
NOTE: The following instructions are rarely, if ever, needed with R 4.2+
On many of our machines, the $HOME
directory points to a network share. This can cause all kinds of problems when installing R packages, especially if you connect to the network by VPN. The following code is a one-time solution and will cause R packages to be installed on a local disk by adding an .Rprofile
file to your $HOME
directory. This file will instruct R to use C:/Users/FirstName.LastName/Documents/R/
for installing R packages. Again, you only have to do this once.
# determine your current $HOME directory
path.expand('~')
# install .Rprofile
source('https://raw.githubusercontent.com/ncss-tech/soilReports/master/R/installRprofile.R')
installRprofile(overwrite=TRUE)
soilReports Installation - First time or after R upgrade
Run this code if you don't yet have the soilReports
package or after a new version of R has been installed on your machine.
# need devtools to install packages from GitHub
install.packages('remotes', dep = TRUE)
# get the latest version of the 'soilReports' package
remotes::install_github("ncss-tech/soilReports", dependencies = FALSE, upgrade_dependencies = FALSE)
Choose an Available Report
-
Region 2
-
Region 11
Example Output
Reports for Raster Summary by MU or MLRA
Reports for DMU QC/QA
Reports for Pedon Data
- CA792: mendel
- CA792: canisrocks
- CA792: siberian
- CA792: isosceles
- summary of pedon data
- summary of lab data
- NEW: Shiny Pedon Summary - interactive plots and tables for pedon data
Run a Report - Example: Map Unit Comparison report
# load this library
library(soilReports)
# list reports in the package
listReports()
# install required packages for a named report
reportSetup(reportName='southwest/mu-comparison')
# copy report file 'MU-comparison' to your current working directory
reportInit(reportName='southwest/mu-comparison', outputDir='MU-comparison')
Updating Existing Reports - Example: Map Unit Comparison report
Updates to report templates, documentation, and custom functions are available after installing the latest soilReports
package from GitHub. Use the following examples to update an existing copy of the "southwest/mu-comparison" report. Note that your existing configuration files will not be modified.
# get latest version of package + report templates
remotes::install_github("ncss-tech/soilReports", dependencies=FALSE, upgrade_dependencies=FALSE)
# load this library
library(soilReports)
# get any new packages that may be required by the latest version
reportSetup(reportName='southwest/mu-comparison')
# overwrite report files in an existing report instance (does NOT overwrite config)
reportUpdate(reportName='southwest/mu-comparison', outputDir='MU-comparison')
Suggested Background Material
- The user is familiar with Rstudio
- NASIS selected set is loaded with the necessary tables (e.g. "Project - legend/mapunit/dmu by sso, pname & uprojectid")
- ODBC connection to NASIS is setup
- custom .Rprofile exists
- necessary R packages are installed
Troubleshooting
- If you haven't run R in a while, consider updating all packages with:
update.packages(ask=FALSE, checkBuilt=TRUE)
. - Make sure that all raster data sources are GDAL-compatible formats: GeoTiff, ERDAS IMG, ArcGRID, etc. (not ESRI FGDB)
- Make sure that the map unit polygon data source is an OGR-compatible format: ESRI SHP, ESRI FGDB, etc.
- Make sure that the extent of raster data includes the full extent of map unit polygon data.
- If there is a problem installing packages with
reportSetup()
, consider adding theupgrade=TRUE
argument. - If you are encountering errors with "Knit HTML" in RStudio, try:
update.packages(ask=FALSE, checkBuilt=TRUE)
.
TODO
See issue tracker for TODO items.
Related Packages
Owner metadata
- Name: ncss-tech
- Login: ncss-tech
- Email:
- Kind: organization
- Description: Collection of repositories contributed by members of the National Cooperative Soil Survey
- Website: http://ncss-tech.github.io/AQP/
- Location: United States of America
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/10520265?v=4
- Repositories: 67
- Last ynced at: 2023-06-14T17:35:13.002Z
- Profile URL: https://github.com/ncss-tech
GitHub Events
Total
- Watch event: 1
- Push event: 16
- Create event: 1
Last Year
- Watch event: 1
- Push event: 16
- Create event: 1
Committers metadata
Last synced: 5 days ago
Total Commits: 644
Total Committers: 8
Avg Commits per committer: 80.5
Development Distribution Score (DDS): 0.582
Commits in past year: 34
Committers in past year: 2
Avg Commits per committer in past year: 17.0
Development Distribution Score (DDS) in past year: 0.029
Name | Commits | |
---|---|---|
Dylan Beaudette | d****e@g****m | 269 |
Brown | 1****1@F****V | 258 |
Stephen Roecker | s****r@g****m | 73 |
jennifer-wood | j****d@c****v | 35 |
John Hammerly | h****y | 3 |
Alena | a****s | 3 |
Jay Skovlin | 1****2@F****V | 2 |
Darío Hereñú | m****a@g****m | 1 |
Committer domains:
- fedidcard.gov: 2
- ca.usda.gov: 1
Issue and Pull Request metadata
Last synced: 2 days ago
Total issues: 103
Total pull requests: 13
Average time to close issues: 6 months
Average time to close pull requests: about 1 month
Total issue authors: 3
Total pull request authors: 2
Average comments per issue: 1.48
Average comments per pull request: 1.0
Merged pull request: 13
Bot issues: 0
Bot pull requests: 0
Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- dylanbeaudette (86)
- brownag (16)
- smroecker (1)
Top Pull Request Authors
- brownag (12)
- kant (1)
Top Issue Labels
- enhancement (22)
- bug (5)
Top Pull Request Labels
- enhancement (3)
- help wanted (1)
Dependencies
- actions/cache v2 composite
- actions/checkout v2 composite
- actions/upload-artifact main composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite
- R >= 3.5.0 depends
- remotes * imports
- MASS * suggests
- clhs * suggests
- knitr * suggests
- rmarkdown * suggests
- scales * suggests
- sharpshootR * suggests
- testthat * suggests
Score: 6.327936783729195