Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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.

NotificationsYou must be signed in to change notification settings

ncss-tech/soilReports

Repository files navigation

R-CMD-check

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 ofR-based reporting tools. Inside the package are report templates, setup files, documentation, and example configuration files.

ThesoilReports 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 metadata
  • reportSetup(...): download any R packages required by the named report, e.g."southwest/mu-comparison"
  • reportInit(...) |reportCopy(...): copy a named report template into a specific directory
  • reportUpdate(...): update a named report in a specific directory, replacingreport.Rmd only

Each report contains several files:

  • report.Rmd: anR Markdown file that is "knit" into a final HTML or DOC report
  • README.md: report-specific instructions
  • custom.R: report-specific functions
  • categorical_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 useC:/Users/FirstName.LastName/Documents/R/ for installing R packages. Again, you only have to do thisonce.

# determine your current $HOME directorypath.expand('~')# install .Rprofilesource('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 thesoilReports package or after a new version of R has been installed on your machine.

# need devtools to install packages from GitHubinstall.packages('remotes',dep=TRUE)# get the latest version of the 'soilReports' packageremotes::install_github("ncss-tech/soilReports",dependencies=FALSE,upgrade_dependencies=FALSE)

Choose an Available Report

Example Output

Reports for Raster Summary by MU or MLRA

Reports for DMU QC/QA

Reports for Pedon Data

Run a Report - Example: Map Unit Comparison report

# load this librarylibrary(soilReports)# list reports in the packagelistReports()# install required packages for a named reportreportSetup(reportName='southwest/mu-comparison')# copy report file 'MU-comparison' to your current working directoryreportInit(reportName='southwest/mu-comparison',outputDir='MU-comparison')

Updating Existing Reports - Example: Map Unit Comparison report

Updates to report templates, documentation, and custom functions are availableafter installing the latestsoilReports 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 templatesremotes::install_github("ncss-tech/soilReports",dependencies=FALSE,upgrade_dependencies=FALSE)# load this librarylibrary(soilReports)# get any new packages that may be required by the latest versionreportSetup(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

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 areGDAL-compatible formats: GeoTiff, ERDAS IMG, ArcGRID, etc. (not ESRI FGDB)
  • Make sure that the map unit polygon data source is anOGR-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 withreportSetup(), consider adding theupgrade=TRUE argument.
  • If you are encountering errors with "Knit HTML" in RStudio, try:update.packages(ask=FALSE, checkBuilt=TRUE).

TODO

Seeissue tracker for TODO items.

Related Packages

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors7


[8]ページ先頭

©2009-2025 Movatter.jp