Revision b02e39a0
Added by Jim Regetz over 13 years ago
- ID b02e39a0b4de755bb216f9272065a6d838530cc1
terrain/slope/slope-assessment.R | ||
---|---|---|
61 | 61 |
# |
62 | 62 |
|
63 | 63 |
# simple helper function to calculate row-wise RMSEs |
64 |
rmse <- function(r1, r2, na.rm=TRUE) { |
|
65 |
sqrt(rowMeans(as.matrix((r1 - r2)^2), na.rm=na.rm)) |
|
64 |
rmse <- function(r1, r2, na.rm=TRUE, use) { |
|
65 |
diffs <- abs(as.matrix(r1) - as.matrix(r2)) |
|
66 |
if (!missing(use)) diffs[!use] <- NA |
|
67 |
sqrt(rowMeans(diffs^2, na.rm=na.rm)) |
|
66 | 68 |
} |
67 | 69 |
|
68 | 70 |
par(mfrow=c(2,3), omi=c(1,1,1,1)) |
Also available in: Unified diff
added R code to create various boundary assessment figures