What is wrong is that you are using the condition which(ff[,1:ncol(ff)]>2.5)
to choose rows (we know that there is only a single row) rather than columns. Hence,
ff[, which(ff[,1:ncol(ff)]>2.5)]
would work. Or simply
ff[, ff > 2.5]
3
solved Subset Columns in R using which