calculateScore.simple <- function(x, y, measurement ){
library(tidyverse)
thresholddataframe=data_frame(threshold.value=x,score=c(y,"NA"))
result <- vector("numeric", length(measurement))
for(i in 1:length(measurement)){
for(j in 1:length(x)){
if ((measurement[i]>=thresholddataframe[j,1])&&(measurement[i]<thresholddataframe[j+1,1])){
score=(as.numeric(thresholddataframe[j,2]))}
}
result[i] <- score
}
return(result)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.