Skip to content
Snippets Groups Projects
Commit 4c2ea4be authored by Fabian Stenzel's avatar Fabian Stenzel
Browse files

changed indexing from/to in zhang add modelled function

parent ea9a69cd
No related branches found
No related tags found
No related merge requests found
......@@ -324,6 +324,8 @@ add_modelled_npp_to_zhang_npp_measurements <- function(zhang_data, modelled_npp)
# Average,1991,1959-98,1988-90,Potential,1993,1986-93,1982-89,1983-90,1992,1982-96,1988,latest interval,1990-93,1987-97
from <- c( 51, 91, 59, 88, NA, 93, 86, 82, 83, 92, 82, 88, NA, 90, 87) - (2000-min_model_year)
to <- c( 122, 91, 98, 90, NA, 93, 93, 89, 90, 92, 96, 88, NA, 93, 97) - (2000-min_model_year)
from[from<1] <- 1
to[to<1] <- 1
npp_measured <- zhang_data$totnpp
npp_modelled <- array(NA,dim=length(npp_measured))
for (i in 1:length(npp_measured)){
......@@ -374,4 +376,4 @@ scatter_plot <- function(x, y, file = NULL, title = "", xlab = "", ylab = ""){
fit <- summary(lm(x~y))
text(x = 0, y = max*0.9,paste("R^2 =",round(fit$r.squared,4)),adj=c(0,1))
if (!is.null(file)) dev.off()
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment