I have a table where there are “NA”s littered all over the place in one column in particular. I want to replace every instance of “NA” with something else — say, the number 1.
How should I do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Jonathan has the right answer for a vector, which you can apply to column a in data frame dat using:
For completeness using Deducer’s ‘Recode Variables’ dialog, which can do much more complicated recodings, produces the following code.