You can use "next" in you processing loop to jump when detecting a file with at least one missing value in a specific column
# example input is a list of two dataframes, one with missing value in column 2
dd <- list(data.frame(x = 1:2, y = c(1, NA)),
data.frame(x = 1:2, y = 1:2))
# loop through the list and print list item/data.frame (you get both data.frames printed)
for (i in 1:length(dd)){
print(dd[[i]])
}
# now the same loop but with a jump in case colum 2 has any value (only the second data.frame is printed)
for (i in 1:length(dd)){
# if any value in column 2 is NA then jump loop
if (sum(is.na(dd[[i]][,2])) != 0) next
print(dd[[i]])
}
It might be better to impute the missing values, depending on what your are trying to achive or it might even be possible to adapt your processing to handle the possibly missing line, etc. Anyhow instead of deleting, just jumping might be better. You can also alter the code to delete the just read in file, once a missing value in the specific column is detect (instead of "next" you would use a function to remove the file)
Adapted acording to list.files():
for (i in 1:length(file.list)){
df <-read.table(file.list[i]) #not sure which function you are using
if(ncol(df) != 54) next #make sure the file has 54 columns
if(sum(is.na(df[,22])) != 0) next #make sure you jump in case of at least 1 na in column 22
print(df)
}