So I'm trying to create a loop which reads input files based on the value present in a column 4 of my data frame.
for (idx in 1:nrow(config_path_test)) {
if (config_path_test[idx,2] == "ens84" & is.na(config_path_test[idx,4]))
{#process Raw data}
else {
if(config_path_test[idx,2] == "ens84" & !is.na(config_path_test[idx,4]))
{#process TPM data}
}
Tested my code with column 4 containing paths to my data in all fields, no paths in any of the fields or a combination of both (some have paths, some will not).
Code above deals with both all and no fields succesfully. However, for the combination of both, I'm a bit stuck.
As no paths being present is reflected for the entire column as NA, i've been using:
is.na() and !is.na()
However, a combination of both will not show NA for the missing values. The fields are blank.
Any idea how to change my code to process the blank fields? Or any idea on how to process the blank values to NA?
Thanks in advance