Link: https://gist.github.com/emanuelhuber/7688d5b476f0c3751c7be4c99bb2d7bd
use findInterval()
# do not plot the box
bty = "n"
| library("sf") | |
| library("terra") | |
| library("viridis") | |
| # Finite Line Source (Eskilson, 1987) | |
| # FLS | |
| # s = term to be integrated, ranges from D to D+L (m) | |
| # aB = temperaturleitfähigkeit (m2/s) | |
| # D = Überdeckung der Sonde (m) | |
| # L = Sondenlänge (m) |
| library(sf) | |
| library(deldir) | |
| require(igraph) | |
| # require(gstat) | |
| require(smoothr) | |
| require(tripack) | |
| require(spatstat) | |
| library(fields) | |
| library(gstat) |
| library(xts) | |
| library(lubridate) | |
| # Write time-series for FEFLOW | |
| # userunit = m^3/d, l/min, m, ^0C | |
| writeTS <- function(fPath, x, | |
| option = c("linear", "cyclic"), | |
| type = c("Polylined", "Constant"), | |
| unitclass = c("PUMP_RATE", "TEMPERATURE", "LENGTH", "VELOCITY", "PUMP_HEAT_RATE"), | |
| userunit, |
| # Add a logo at the bottom left of a plot (outside plot area). | |
| # obj = raster image | |
| # wight = width in % of figure width | |
| # shift in inch (x, y) | |
| # interpolate Raster (=smooth) | |
| #--- | |
| # inspiration: https://stackoverflow.com/a/56018973/16599100 | |
| addLogo <- function(obj, width = 0.25, shift = c(0,0), interpolate = TRUE){ | |
| xsign <- ifelse(diff(par()$usr[1:2]) > 0, 1, -1) | |
| ysign <- ifelse(diff(par()$usr[3:4]) > 0, 1, -1) |
| if(!require("openxlsx")) install.packages("openxlsx") | |
| library("openxlsx") | |
| # this function open an explorer window. | |
| # select the file you want to split | |
| # the file is split into files according to the values | |
| # in the column "Projektleitung" | |
| splitExcelFile <- function(fpath = NULL, fpathold = TRUE, startRow = 1){ |
| addPolySeq <- function(tval, y, ylim, ...){ | |
| i <- seq(1, by = 2, to = length(tval)- 1) | |
| tval_p <- cbind(tval[i], tval[i + 1]) | |
| u <- (apply(tval_p, 1, FUN, y = y, ylim = ylim, ...)) | |
| u | |
| } | |
| FUN <- function(x, y, ylim, ...){ | |
| ynew <- y[paste0(c(as.Date(x[1]), as.Date(x[2])), collapse = "/")] | |
| nr <- nrow(ynew) | |
| if(nr > 0){ |
Link: https://gist.github.com/emanuelhuber/7688d5b476f0c3751c7be4c99bb2d7bd
use findInterval()
# do not plot the box
bty = "n"
| % Encoding: UTF-8 | |
| @Article{affolter&al:2010, | |
| Title = {Adaptives Grundwassermanagement in urbanen Gebieten}, | |
| Author = {A. Affolter and P. Huggenberger and S. Scheidler and J. Epting}, | |
| Journal = {Grundwasser}, | |
| Year = {2010}, | |
| Month = {jun}, | |
| Number = {3}, |
| # Exemple | |
| # # | |
| # a <- locator() | |
| # xy0 <- do.call(cbind, a) | |
| # lat <- transect(xy0, d = c(0.00001, -0.000003)) | |
| # plot(xy0, asp = 1, type = "o", pch = 20) | |
| # segments(xy0[, 1], xy0[, 2], lat$x[, 1], lat$y[, 1], col = "blue") | |
| # segments(xy0[, 1], xy0[, 2], lat$x[, 2], lat$y[, 2], col = "red") | |
| #' Points perdicular to a polyline |
| #!/usr/bin/env Rscript | |
| #----------------------------------------------------------------------------- | |
| # How to run? | |
| # In terminal enter: Rscript --vanilla r2jekyll.R my_RMarkdownFile.Rmd | |
| #----------------------------------------------------------------------------- | |
| # Problem while rendering Rmarkdown files with latex equation into markdown file | |
| # -> Rmarkdown try to convert the equation into markdown instead of leaving them | |
| # as latex equation. In consequences, the equations within the mardown file |