Description Usage Arguments Examples
Vertical or Slope-Normal Integration/Aggregation of soil water content
1 | SoilVariableProfile(x, points, names = NULL...)
|
x |
soil variable |
points |
data frame with x and y coordinates of the pointe where to extract the soil profile |
names |
names of the points |
... |
further arguments |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | data(PsiTheta)
t <- 5
map <- psi[[t]]
yv <- (ymax(map)+ymin(map))/2
points <- data.frame(x=c(32,41),y=yv,id=c("A","B"))
mapProfile <- SoilVariableProfile(map,points[,c("x","y")],names=as.character(points$id))
plot(mapProfile[,2],c(100:1),type="l")
lines(mapProfile[,1],c(100:1))
####
library(stingr)
library(ggplot2)
library(reshape2)
times <- c(1,2,4,8)
names(psi) <- sprintf("time%02dhr",1:length(psi))
names(theta) <- names(psi)
names(times) <- sprintf("%02dhr",times)
dz <- as.numeric(sapply(X=str_split(names(psi[["01hr"]]),"_"),FUN=function(x){x[2]}))
z <- dz/2.0
for (i in 2:length(z)) {
z[i] <- z[i-1]+(dz[i]+dz[i-1])/2
}
profiles <- as.data.frame(lapply(X=psi[names(times)],FUN=SoilVariableProfile,points=points[,c("x","y")],names=as.character(points$id)))
profiles$depth <- z
profiles_m <- melt(profiles,id="depth")
profiles_m$time <- sapply(X=str_split(profiles_m$variable,"[.]"),FUN=function(x){x[1]})
profiles_m$point <- sapply(X=str_split(profiles_m$variable,"[.]"),FUN=function(x){x[2]})
g <- qplot(value,depth,data=profiles_m,geom="path",group=time)+facet_grid(point ~ time,scale="fixed")+scale_y_reverse()
## THeta
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.