I have a dataframe in R that I would like to convert all columns (outside the ids) from negative to zero
id1 id2 var1 var2 var3 -1 -1 0 -33 5
Edit a bit your variant
temp[,-c(1,2)][temp[, -c(1,2)] < 0] <- 0