Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(tidyverse)
- df <- data_frame(
- id = rep(1:10, 10) %>%
- sort,
- visit = rep(1:10, 10),
- value = rnorm(100)
- )
- vals_int <- c(1, 2, 3)
- tmp <- sapply(vals_int,
- function(val_i) abs(df$value - val_i))
Add Comment
Please, Sign In to add comment