I have a large dataset of samples with descriptors of whether the sample is viable - it looks (kind of) like this, where \'desc\' is the description column and \'blank\' ind
Here's another dplyr solution with a small custom function and mutate_each().
library(dplyr)
f <- function(x) if_else(dat$desc == "blank", NA_real_, x)
dat %>%
mutate_each(funs(f), -desc)
#> desc x y z
#> 1 blank NA NA NA
#> 2 blank NA NA NA
#> 3 sample 3.624941 6.430955 5.486632
#> 4 sample 3.236359 4.935453 4.319202
#> 5 blank NA NA NA
#> 6 blank NA NA NA
#> 7 blank NA NA NA
#> 8 sample 5.058725 6.751650 4.750529
#> 9 sample 5.837206 4.323562 4.914780
#> 10 blank NA NA NA