Skip to content
Prev 261870 / 398502 Next

modify a data frame by values in the columns

Hi Jason,

This is one way;

c1 <- seq(2,20,2)
c2 <- seq(1,19,2)
c3 <- cbind(c1,c2)

c3[,1][which(c3[,1]<12)] <- -1
c3[,2][which(c3[,2]>10)] <- -1

Muhammad
On Fri, 3 Jun 2011, Jason024 wrote: