ULTRON <- function(directory, pollutant, id = 1:332) {
files_full <- list.files(directory, full.names = TRUE)
dat <- data.frame()
for (i in id) {
dat <- rbind(dat, read.csv(files_full[i]))
}
mean(dat[, pollutant], na.rm = TRUE)
}
Can some one explain me in detail what the below line does in the above code
dat <- rbind(dat, read.csv(files_full[i]))
I am not able to understand how the data frame passed in the rbind is working and what it returns.