-3

I want to fill a variable that is currently filled with NA, with "fem" text. See below:

enter image description here

I have tried merge, coalesce, and some other ways but I am new to R and was probably doing those wrong. I just need help to fill this column ("female") with "fem".

phalteman
  • 3,442
  • 1
  • 29
  • 46

1 Answers1

0

In your case, ppp$female <- "fem" will work fine. As per the comments, more general approaches (e.g., when you have NAs mixed with other values) might be more broadly helpful.

phalteman
  • 3,442
  • 1
  • 29
  • 46