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
Written by Dionysios Barmpoutis
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#R
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#