Skip to content

Commit

Permalink
Update ST-tree.R
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanbeaudette committed Apr 10, 2024
1 parent 27fdb36 commit 6c095c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions misc/ST-tree.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ data('ST', package = 'SoilTaxonomy')

## this is the most detailed acreage accounting
# subgroup acreages from SoilWeb / SSURGO
sg.ac <- read.table(file='databases/taxsubgrp-stats.txt.gz', header = FALSE, sep="|")
sg.ac <- read.table(file = '../SoilWeb-data/files/taxsubgrp-stats.txt.gz', header = FALSE, sep="|")
names(sg.ac) <- c('subgroup', 'ac', 'n_polygons')

# normalize names
sg.ac$subgroup <- tolower(sg.ac$subgroup)

# LEFT JOIN to acreage
ST <- merge(ST, sg.ac, by='subgroup', all.x=TRUE)
ST <- merge(ST, sg.ac, by = 'subgroup', all.x = TRUE)

# set NA acreage to 0
ST$ac[which(is.na(ST$ac))] <- 0
Expand Down

0 comments on commit 6c095c4

Please sign in to comment.