Skip to content

Commit

Permalink
Update SSURGO-ST-edition-eval.R
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanbeaudette committed Sep 27, 2023
1 parent 16aa43d commit b11de1d
Showing 1 changed file with 49 additions and 1 deletion.
50 changes: 49 additions & 1 deletion misc/SSURGO-ST-edition-eval.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,56 @@ library(lattice)
library(latticeExtra)
library(tactile)


SDA_query("SELECT
SUM(muacres) AS ac
FROM legend
INNER JOIN mapunit mu ON mu.lkey = legend.lkey
WHERE legend.areasymbol != 'US' ;")

SDA_query("SELECT
SUM(CAST(muacres AS numeric)) AS ac
FROM legend
INNER JOIN mapunit mu ON mu.lkey = legend.lkey
WHERE legend.areasymbol != 'US' ;")


SDA_query("SELECT
SUM(muacres) / 1000000 AS ac
FROM legend
INNER JOIN mapunit mu ON mu.lkey = legend.lkey
WHERE legend.areasymbol != 'US' ;")

SDA_query("SELECT
SUM(muacres / 1000000.0) AS ac
FROM legend
INNER JOIN mapunit mu ON mu.lkey = legend.lkey
WHERE legend.areasymbol != 'US' ;")

SDA_query("SELECT
SUM(muacres / 1000000) AS ac
FROM legend
INNER JOIN mapunit mu ON mu.lkey = legend.lkey
WHERE legend.areasymbol != 'US' ;")

SDA_query("SELECT
SUM(CAST(muacres AS numeric) / 1000000) AS ac
FROM legend
INNER JOIN mapunit mu ON mu.lkey = legend.lkey
WHERE legend.areasymbol != 'US' ;")



SDA_query("SELECT
SUM((comppct_r / 100) * muacres) / 1000000 AS ac
FROM legend
INNER JOIN mapunit mu ON mu.lkey = legend.lkey
INNER JOIN component AS co ON mu.mukey = co.mukey
WHERE legend.areasymbol != 'US' ;")


SDA_query("SELECT
SUM((CAST(comppct_r AS NUMERIC) / 100.0) * CAST(muacres AS numeric)) / 1000000 AS ac
SUM((CAST(comppct_r AS NUMERIC) / 100) * CAST(muacres AS numeric)) / 1000000 AS ac
FROM legend
INNER JOIN mapunit mu ON mu.lkey = legend.lkey
INNER JOIN component AS co ON mu.mukey = co.mukey
Expand Down

0 comments on commit b11de1d

Please sign in to comment.