I have tried all I can think of, but haven't had any luck so far.
This was my best guess, but it just returns NULL for the column name (I'm guessing because once I've extracted the data of the column it's already a nameless vector?).
for (i in seq_along(df)) {
# Print column name
print(colnames(df[[i]]))
# Print sum of missing values for each column
print(sum(is.na(df[[i]])))
# Print NA value rows
}
Output is as follows:
NULL
[1] 70
NULL
[1] 0
NULL
[1] 0
NULL
[1] 0
NULL
What can I do to print the column name for each pass?