Is this what you wan to do?
library(dplyr)
master <- data.frame(
stringsAsFactors = FALSE,
TDS = c("10","14","ND","10","14",
"ND","14","ND","10","14","ND"),
TSS = c("2.2","2.5","N/A","2.2",
"2.5","N/A","2.5","N/A","2.2","2.5","N/A"),
VSS = c(3.5, 3.75, 5, 3.5, 3.75, 5, 3.75, 5, 3.5, 3.75, 5),
TKN = c("ND","0.01","0.2","ND",
"0.01","0.2","0.01","0.2","ND","0.01","0.2"),
DOC = c("10","14","ND","10","14",
"ND","14","ND","10","14","ND"),
TOC = c("2.2","2.5","N/A","2.2",
"2.5","N/A","2.5","N/A","2.2","2.5","N/A"),
DON = c(3.5, 3.75, 5, 3.5, 3.75, 5, 3.75, 5, 3.5, 3.75, 5),
Chla = c("ND","0.01","0.2","ND",
"0.01","0.2","0.01","0.2","ND","0.01","0.2")
)
master %>%
mutate_if(is.character, ~ if_else(. == "ND", "0", .)) %>%
mutate_all(as.numeric) # Your variables are saved as text, so this extra step would be a good idea
#> TDS TSS VSS TKN DOC TOC DON Chla
#> 1 10 2.2 3.50 0.00 10 2.2 3.50 0.00
#> 2 14 2.5 3.75 0.01 14 2.5 3.75 0.01
#> 3 0 NA 5.00 0.20 0 NA 5.00 0.20
#> 4 10 2.2 3.50 0.00 10 2.2 3.50 0.00
#> 5 14 2.5 3.75 0.01 14 2.5 3.75 0.01
#> 6 0 NA 5.00 0.20 0 NA 5.00 0.20
#> 7 14 2.5 3.75 0.01 14 2.5 3.75 0.01
#> 8 0 NA 5.00 0.20 0 NA 5.00 0.20
#> 9 10 2.2 3.50 0.00 10 2.2 3.50 0.00
#> 10 14 2.5 3.75 0.01 14 2.5 3.75 0.01
#> 11 0 NA 5.00 0.20 0 NA 5.00 0.20
Created on 2020-03-19 by the reprex package (v0.3.0.9001)
Have in mind that NA (Not Available) is the way R handles the "blanks", if you replace that for let's say this " ", you are going to get a character variable and you are not going to be able to use it for numerical calculations.