Answers for "Replace blank with NA in R"

R
1

replace na with 0 in R

library(dplyr)
#Replacing missing values with 0 in columns 'x' and 'y' of the tibble dataframe 'df'
df %>% 
  replace_na(list(x = 0, y = 0))
Posted by: Guest on August-16-2020
0

r replace blank string with na

library(dplyr)

mutate_all(df, list(~na_if(.,"")))
Posted by: Guest on November-24-2021

Browse Popular Code Answers by Language