Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanbeaudette committed Oct 4, 2023
1 parent d5a65de commit 7e63ee0
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 13 deletions.
Binary file added SSA-complexity/FD-summary-FY2024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SSA-complexity/FD-vs-H-FY2024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 21 additions & 6 deletions SSA-complexity/MU-entropy.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ g[idx, ]$entropy - g[idx, ]$H.max
tps <- tactile.theme(plot.symbol = list(cex = 0.5))


histogram( ~ entropy | which, data = g, par.settings = tps, breaks = 100, scales = list(alternating = 1, x = list(tick.number = 10), y = list(alternating = 3)), xlab = 'Shannon Entropy (base 2)')
histogram( ~ entropy | which, data = g, par.settings = tps, breaks = 100, scales = list(alternating = 1, x = list(tick.number = 10), y = list(alternating = 3)), xlab = 'Shannon Entropy (base 2)')

histogram( ~ entropy / H.max | which, data = g, par.settings = tps, breaks = 100, scales = list(alternating = 1, x = list(tick.number = 10), y = list(alternating = 3)), xlab = 'Shannon Entropy / Equal-Probability Entropy')

Expand Down Expand Up @@ -171,6 +171,21 @@ bwplot(invesintens ~ entropy,
}
)

# SSURGO only
bwplot(invesintens ~ entropy,
data = g,
subset = which == 'SSURGO',
par.settings = tps,
xlab = 'Shannon Entropy (base 2)',
main = '',
scales = list(x = list(tick.number = 10)),
varwidth = FALSE,
panel = function(...) {
panel.grid(h = 0, v = -1)
panel.bwplot(...)
}
)




Expand Down Expand Up @@ -212,7 +227,7 @@ ggplot(g, aes(x = entropy, y = mukind)) +
scale_color_brewer(palette = 'Blues') +
scale_x_continuous(n.breaks = 10) +
xlab('Shannon Entropy (base 2)\nSingle Component and Misc. Area MU Removed') + ylab('') +
labs(title = 'All Survey Areas FY23', color = 'Interval')
labs(title = 'All Survey Areas FY24', color = 'Interval')


ggplot(g, aes(x = entropy, y = invesintens)) +
Expand All @@ -224,7 +239,7 @@ ggplot(g, aes(x = entropy, y = invesintens)) +
scale_color_brewer(palette = 'Blues') +
scale_x_continuous(n.breaks = 10) +
xlab('Shannon Entropy (base 2)\nSingle Component and Misc. Area MU Removed') + ylab('') +
labs(title = 'All Survey Areas FY23', color = 'Interval')
labs(title = 'All Survey Areas FY24', color = 'Interval')



Expand All @@ -238,7 +253,7 @@ ggplot(g, aes(x = n, y = mukind)) +
scale_color_brewer(palette = 'Blues') +
scale_x_continuous(n.breaks = 10) +
xlab('Number of Components\nSingle Component and Misc. Area MU Removed') + ylab('') +
labs(title = 'All Survey Areas FY23', color = 'Interval')
labs(title = 'All Survey Areas FY24', color = 'Interval')


ggplot(g, aes(x = n, y = invesintens)) +
Expand All @@ -250,7 +265,7 @@ ggplot(g, aes(x = n, y = invesintens)) +
scale_color_brewer(palette = 'Blues') +
scale_x_continuous(n.breaks = 10) +
xlab('Number of Components\nSingle Component and Misc. Area MU Removed') + ylab('') +
labs(title = 'All Survey Areas FY23', color = 'Interval')
labs(title = 'All Survey Areas FY24', color = 'Interval')



Expand All @@ -268,7 +283,7 @@ ggplot(g.sub, aes(x = entropy, y = mukind)) +
scale_color_brewer(palette = 'Blues') +
scale_x_continuous(n.breaks = 10) +
xlab('Shannon Entropy (base 2)\nSingle Component and Misc. Area MU Removed') + ylab('') +
labs(title = '1:12,000 and 1:24,000 Surveys FY23', color = 'Interval')
labs(title = '1:12,000 and 1:24,000 Surveys FY24', color = 'Interval')



Expand Down
16 changes: 11 additions & 5 deletions SSA-complexity/combined-analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,31 @@ z <- z[which(z$entropy > 0), ]


# figure elements and style
.fy <- '2023'
.fy <- '2024'
.title <- sprintf('FY%s SSURGO\n100k Samples', .fy)
.cp <- hcl.colors(100, 'zissou1')
.cpf <- colorRampPalette(.cp)

.file <- sprintf("FD-vs-H-FY%s.png", .fy)
ragg::agg_png(file = .file, width = 1200, height = 1200, scaling = 2)

hexbinplot(
fd ~ entropy,
data = z,
xbins = 25,
xbins = 60,
main = .title,
xlab = 'Shannon Entropy (base 2)',
ylab = 'Fractal Dimension',
xlab = 'Shannon Entropy [base 2] (component percentages)',
ylab = 'Fractal Dimension (geometry)',
trans = log,
inv = exp,
asp = 1,
colramp = .cpf,
type = 'g',
subset = fd < 1.9,
scales = list(tick.number = 6, alterntating = 1),
scales = list(tick.number = 8, alterntating = 1),
colorkey = FALSE,
par.settings = tactile.theme()
)

dev.off()

Binary file modified SSA-complexity/entropy-by-mukey-statsgo.csv.gz
Binary file not shown.
Binary file modified SSA-complexity/entropy-by-mukey.csv.gz
Binary file not shown.
Binary file modified SSA-complexity/fractal-dimension-test.csv.gz
Binary file not shown.
Binary file modified SSA-complexity/mukind-entropy-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions SSA-complexity/notes.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ x$invesintens <- factor(x$invesintens, levels = c('missing', 'Order 1', 'Order 2

x$projectscale <- factor(x$projectscale)

.fy <- '2023'
.fy <- '2024'

table(x$areasymbol)
table(x$invesintens)
Expand Down Expand Up @@ -248,6 +248,6 @@ ecdf(x$fd)(1.48329949700171)
ecdf(x$fd)(1.29691553046904)



x[x$fd > 1.9, ]


0 comments on commit 7e63ee0

Please sign in to comment.