Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- correl <- function(prah=0) {
- ret_vec <- vector()
- file_ids <- 1:332
- for (file_id in file_ids) {
- filename <- sprintf("%03d.csv")
- file <- read.csv(filename)
- val_entries <- nrow(file[complete.cases(file), ])
- if (val_entries >= prah) {
- # file <- read.csv(filename)
- sulf_vec <- file$sulfate
- nitr_vec <- file$nitrate
- correlation <- cor(sulf_vec, nitr_vec, na.rm=TRUE)
- append(ret_vec, correlation)
- }
- }
- return ret_vec
- }
Add Comment
Please, Sign In to add comment