You are viewing a single comment's thread. Return to all comments →
in R could be
stdin <- file('stdin') open(stdin) n <- as.integer(trimws(readLines(stdin, n = 1, warn = FALSE), which = "both")) dataX <- as.numeric(strsplit(trimws(readLines(stdin, n = 1, warn = FALSE), which = "right"), " ")[[1]]) dataY <- as.numeric(strsplit(trimws(readLines(stdin, n = 1, warn = FALSE), which = "right"), " ")[[1]]) correlation = cor(dataX, dataY, method = 'pearson') cat(round(correlation, 3))
Seems like cookies are disabled on this browser, please enable them to open this website
Day 7: Pearson Correlation Coefficient I
You are viewing a single comment's thread. Return to all comments →
in R could be