knitr::opts_chunk$set(echo = TRUE)
Interpolate the locations of values within an ordered vector viewed from left to right.
Inpsired by locate() from numerical recipes, base::findInterval() and VALUE_LOCATE() from IDL.
remotes::install_github("BigelowLab/locate")
library(locate) x <- c(13, 7, 22) locate(x, 10:19) locate(x, 19:10) x <- c("zoo", "dog", "fish", "cat") locate(x, letters) locate(x, letters, USE.NAMES = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.