{"id":20074877,"url":"https://github.com/ncss-tech/pedotransfr","last_synced_at":"2026-01-06T08:37:59.279Z","repository":{"id":69653028,"uuid":"219037732","full_name":"ncss-tech/pedotransfR","owner":"ncss-tech","description":"Pedotransfer functions used by the NCSS, typically as-implemented in NASIS","archived":false,"fork":false,"pushed_at":"2024-02-11T03:58:33.000Z","size":165,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-02-01T22:51:04.441Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ncss-tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-01T18:04:38.000Z","updated_at":"2024-02-11T03:58:37.000Z","dependencies_parsed_at":"2024-11-13T15:05:55.561Z","dependency_job_id":null,"html_url":"https://github.com/ncss-tech/pedotransfR","commit_stats":{"total_commits":19,"total_committers":2,"mean_commits":9.5,"dds":0.1578947368421053,"last_synced_commit":"9487d49f53f18f731f9db75c828b281a22f224a1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncss-tech%2FpedotransfR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncss-tech%2FpedotransfR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncss-tech%2FpedotransfR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncss-tech%2FpedotransfR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ncss-tech","download_url":"https://codeload.github.com/ncss-tech/pedotransfR/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245921668,"owners_count":20694360,"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":[],"created_at":"2024-11-13T14:55:24.176Z","updated_at":"2026-01-06T08:37:59.232Z","avatar_url":"https://github.com/ncss-tech.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pedotransfR\n\n## Installation of R package\n\nGet the latest development version from GitHub. This will require the latest version of `remotes` -- install that first from CRAN if you need it.\n\n```r\nremotes::install_github(\"ncss-tech/pedotransfR\")\n```\n\n## Example: AASHTO Group Index for component data retrieved from Soil Data Access (SDA)\n\n```r\nlibrary(aqp)\nlibrary(soilDB)\nlibrary(pedotransfR)\n\n# use soilDB fetch function to get some soils information from SDA \n#   these are soils with varying amounts of ASP -- wide range in aashto gin\nf \u003c- fetchSDA(WHERE = \"compname IN ('Mantree','Redapple',\n                        'Devilsnose','Lilygap')\")\n\n# optional: subset with e.g. subsetProfiles()\nf.sub \u003c- f\n\n# construct custom SDA queries to get more information about the above components\ncomp.q \u003c- paste0(\"SELECT * FROM component \n                  WHERE cokey IN \", \n                    format_SQL_in_statement(site(f)$cokey), \";\")\ncomp \u003c- SDA_query(comp.q)\n\n# get all horizon data corresponding to above components\nhz.q \u003c- paste0(\"SELECT * FROM chorizon \n                WHERE cokey IN \", \n                  format_SQL_in_statement(comp$cokey), \n                  \" ORDER BY hzdept_r;\")\nhz \u003c- SDA_query(hz.q) \n\n# get all aashto data corresponding to above horizons\naashto.q \u003c- paste0(\"SELECT * FROM chaashto \n                     WHERE chkey IN \", \n                      format_SQL_in_statement(hz$chkey), \n                      \"AND rvindicator = 'Yes';\")\naashto \u003c- SDA_query(aashto.q)\n\nif(length(aashto)) {\n  hz \u003c- merge(hz, aashto[,c('aashtocl','chkey')], by=\"chkey\")\n} else {\n# if there is no aashto data, fill in the aashtocl column so it is present (NA)\n  hz$aashtocl \u003c- NA  \n}\n\n# optional method for catching organic horizons that have GIN = NULL\n# hz$aashtocl[grepl(hz$hzname, pattern=\"O\")] \u003c- \"A-8\"\n\n# construct an SPC with the full SSURGO data from SDA\nnewspc \u003c- hz\ndepths(newspc) \u003c- cokey ~ hzdept_r + hzdepb_r\n\n# calculate aashto index, take floor() for comparison with integer value in nasis\nnewspc$calc_aashind_r \u003c- floor(ptf_aashind(\n  newspc$sieveno200_r,\n  newspc$ll_r,\n  newspc$pi_r,\n  newspc$aashtocl\n))\n\n# fit linear model to stored versus calculated\nm0 \u003c- lm(newspc$calc_aashind_r ~ newspc$aashind_r)\nstatz \u003c- m0[[1]]\n\n# ensure model intercept is 0 and slope is 1\nall.eq \u003c- all.equal.numeric(as.numeric(m0[[1]]), c(0,1))\n\n# make a plot -- visually check for (lack of) fit\npar(mar=c(5.5, 5.5, 5.5, 5.5))\nplot(newspc$calc_aashind_r ~ newspc$aashind_r,\n     xlab = \"AASHTO Group Index Number\\nStored (NASIS/SSURGO)\",\n     ylab = \"AASHTO Group Index Number\\nCalculated (R package)\",\n     xlim = c(0, max(newspc$aashind_r, na.rm = T)), \n     ylim = c(0, max(newspc$calc_aashind_r, na.rm = T)))\ntext(15,35, paste(\"m = \", m0$coefficients[2], \"\\n\",\n                  \"b = \", m0$coefficients[1], \"\\n\",\n                  \"1:1\", all.eq))\nlegend(\"bottomright\", legend = c(\"Model\", \"1:1\"), \n       lwd = 2, lty = c(1,2), col = c(\"red\",\"blue\"))\nabline(m0, col = \"red\", lwd = 2)\nabline(0, 1, col = \"blue\", lwd = 2, lty = 2)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncss-tech%2Fpedotransfr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fncss-tech%2Fpedotransfr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncss-tech%2Fpedotransfr/lists"}