data(attitude)
x <- scrub(attitude,isvalue =c(30,40,50), newvalue = c(930,940,950)) #will change all occurences
x1 <- scrub(attitude, where=4, isvalue =c(30,40,50), newvalue = c(930,940,950)) #will just do it for the 4th column
#get rid of a complicated set of cases and replace with missing values
y <- scrub(attitude,where=2:4,min=c(20,30,40),max= c(120,110,100),isvalue= c(32,43,54))
y
scrub(attitude,where="learning",isvalue=68,newvalue=999) #change a column by name
scrub(attitude,where="learning",min=45,newvalue=999) #change a column by name
Run the code above in your browser using DataLab