{"id":15893686,"url":"https://github.com/brownag/nasistools","last_synced_at":"2026-05-09T01:02:23.153Z","repository":{"id":127454453,"uuid":"395151195","full_name":"brownag/NASIStools","owner":"brownag","description":"NASIStools: Tools for the USDA-NRCS National Soil Information System (NASIS)","archived":false,"fork":false,"pushed_at":"2023-11-21T01:46:56.000Z","size":768,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-08T08:47:09.519Z","etag":null,"topics":["database","nasis","r","sql","sqlite"],"latest_commit_sha":null,"homepage":"http://humus.rocks/NASIStools/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brownag.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-08-12T00:36:34.000Z","updated_at":"2024-03-01T23:07:57.000Z","dependencies_parsed_at":"2023-11-18T03:23:15.981Z","dependency_job_id":"eb0ec254-64a5-4bdb-833d-c50af2e50729","html_url":"https://github.com/brownag/NASIStools","commit_stats":{"total_commits":54,"total_committers":1,"mean_commits":54.0,"dds":0.0,"last_synced_commit":"a1be2bdb96b9d8c1d4a093f70bb69de65b9903d9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brownag%2FNASIStools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brownag%2FNASIStools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brownag%2FNASIStools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brownag%2FNASIStools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brownag","download_url":"https://codeload.github.com/brownag/NASIStools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246866100,"owners_count":20846496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","nasis","r","sql","sqlite"],"created_at":"2024-10-06T08:12:44.755Z","updated_at":"2026-05-09T01:02:18.116Z","avatar_url":"https://github.com/brownag.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NASIStools\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/brownag/NASIStools/actions/workflows/R-CMD-check.yml/badge.svg)](https://github.com/brownag/NASIStools/actions/workflows/R-CMD-check.yml)\n[![NASIStools Manual](https://img.shields.io/badge/docs-HTML-informational)](https://brownag.github.io/NASIStools/)\n\u003c!-- badges: end --\u003e\n\nThe goal of NASIStools is to provide methods managing NASIS data, SSURGO exports, official metadata as well as to provide ports of legacy code (such as MS Access Macros) to open source alternatives. Use cases primarily relate to data model development, QA/QC of provisional data and inspection of published products. \n\nThis is part of a broader goal to compartmentalize low-level procedures relevant to internal (USDA) usage. Isolating lesser-used, more specific functions allows for more comprehensive testing and opportunities to focus development of the soilDB package.\n\n## Installation\n\nInstall the package off GitHub:\n\n``` r\n# get dependencies\ninstall.packages(c('remotes', 'data.table', 'DBI', 'RSQLite', 'soilDB'))\n\n# get package using remotes\nremotes::install_github(\"brownag/NASIStools\", dependencies=FALSE)\n```\n\n## Example\n\nHere is how to query the \"reasons\" for a particular interpretation `mrulename` rating for the records stored in a SSURGO SQLite database derived from a custom NASIS export.\n\n``` r\nlibrary(NASIStools)\n\n# create a SQLite file database based on the .txt files contained in a SSURGO export\ncreateSSURGO(\"C:/path/to/ssurgo/tabular\", \"ssurgo.sqlite\")\n\n# specify a rule name\nmrulename \u003c-  \"FOR - Mechanical Site Preparation (Surface)\"\n\n# create a DBIConnection to the SQLite database\ndsn \u003c- DBI::dbConnect(RSQLite::SQLite(), \"ssurgo.sqlite\")\n\n# perform a query with NASIStools\nresult \u003c- get_SSURGO_interp_reasons_by_mrulename(dsn, mrulename)\n```\n\n```r\nlibrary(soilDB)\nlibrary(data.table)\n\nmrulename \u003c-  \"WMS - Pond Reservoir Area\" \n\n# \"new\" tabular data from a local export\nresult \u003c- get_SSURGO_interp_reasons_by_mrulename(dsn, mrulename)\n\n# \"old\" tabular data queried from SDA\nresult_ssurgo \u003c- get_SDA_interpretation(mrulename,\n                                        method = \"NONE\",\n                                        areasymbols = c(\"CA630\",\"CA649\"))\n                                        \n# assemble tables of mukey, compname, rating/class and reason\nx1 \u003c- data.table(mukey = result$mukey,\n                 compname = result$compname,\n                 rating_new = result$interphr,\n                 rating_class = result$interphrc,\n                 rating_new_reason = result$Reason)\n\nx2 \u003c- data.table(mukey = result_ssurgo$mukey,\n                 compname = result_ssurgo$compname,\n                 rating_old = result_ssurgo$rating,\n                 rating_class = result_ssurgo$class,\n                 rating_old_reason = result$reason_WMSPondReservoirArea)\n\ncombined_result \u003c- x2[x1, on = c(\"mukey\",\"compname\")]\n\ncombined_result$CHECK \u003c- round(combined_result$rating_new, 2) == round(combined_result$rating_old, 2)\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrownag%2Fnasistools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrownag%2Fnasistools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrownag%2Fnasistools/lists"}