I have a data frame named y
dput(y)
structure(list(val1 = c(25L, 615L, 30L, 76L, 97L, 211L, 0L, 40L,
10L, 10L), val2 = c(101L, 286L, 124L, 77L, 176L, 120L, 0L, 8L,
56L, 49L), val3 = c(157L, 454L, 106L, 242L, 144L, 31L, 0L, 40L,
45L, 57L)), .Names = c("val1", "val2", "val3"), row.names = c(NA,
10L), class = "data.frame")
I would like to be able to view the columns val1 and val2, and if val1> 10, replace the value TRUE else FALSE and look at val2, and if val2 <5, replace the value TRUE else FALSE
I can use the subset function to select them, but instead of using the subset, I like to replace the values with TRUE or FALSE, any ideas how I would do this?