Answers for "replace character(0) with na in r"

R
7

r replace na with 0

d[is.na(d)] <- 0
Posted by: Guest on August-08-2020
0

replace character with na r

# dplyr has the na_if() function 
library(dplyr)
x = c("a", "b", "c", "d")
na_if(x = x, y = "b") # replace "b" with NA
Posted by: Guest on February-03-2021

Browse Popular Code Answers by Language