Created
October 6, 2013 19:37
-
-
Save ansakoy/6858212 to your computer and use it in GitHub Desktop.
Computing for Data Analysis
Programming assignment 2 (part 3)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
corr <- function(directory, threshold = 0) { | |
source("getmonitor.R") | |
source("complete.R") | |
all.cases <- complete("specdata", id = 1:332) | |
needed.cases <- subset(all.cases, all.cases$nobs > threshold) | |
result <- numeric(0) | |
id <- needed.cases$id | |
for (i in id) { | |
data <- getmonitor(i, "specdata") | |
crl <- cor(data$sulfate, data$nitrate, use = "pairwise.complete.obs") | |
result <- c(result, crl) | |
} | |
return (result) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment