Advertisement
Guest User

Untitled

a guest
Nov 13th, 2017
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.13 KB | None | 0 0
  1. library(data.table)
  2. x <- c(1:5, NA, rep(NA, 3), 2:7)
  3. x[!between(x, 3, 7)] <- NA
  4. x
  5. # [1] NA NA  3  4  5 NA NA NA NA NA  3  4  5  6  7
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement