Guest User

Untitled

a guest
Dec 14th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. library(tidyverse)
  2.  
  3. df <- data_frame(
  4. id = rep(1:10, 10) %>%
  5. sort,
  6. visit = rep(1:10, 10),
  7. value = rnorm(100)
  8. )
  9.  
  10. vals_int <- c(1, 2, 3)
  11.  
  12. tmp <- sapply(vals_int,
  13. function(val_i) abs(df$value - val_i))
Add Comment
Please, Sign In to add comment