Danilo, it’s all right?
I suggest we do it this way:
Creating a data frame to serve as an example:
a <- c(1,2,3,4,5,6,7,8,9,10)
b <- c(10,9,8,7,6,5,4,3,2,1)
df <- data.frame(a,b)
> print(df)
a b
1 1 10
2 2 9
3 3 8
4 4 7
5 5 6
6 6 5
7 7 4
8 8 3
9 9 2
10 10 1
One way to obtain only values greater than 6 of column b is as follows::
df$b[df$b > 6]
So, just take advantage of the same idea and directly assign the desired value, which in your case is the NA:
df$b[df$b > 6] <- NA
> print(df)
a b
1 1 NA
2 2 NA
3 3 NA
4 4 NA
5 5 6
6 6 5
7 7 4
8 8 3
9 9 2
10 10 1
I was able to resolve using date[,14:128][date[,14:128] > 6] <-NA
– Danilo Pereira