Last Updated: January 28, 2019
·
1.212K
· dionysios

Replacing Values in Data Frames

Data frames can be treated as vectors when it comes to replacing values. For example in a data frame that all the not available entries have been encoded as -1, we can change them to NA as follows:

dataFrame[dataFrame == -1] = NA