Scatter Plot with Pearson Correlation and Regression Line
df = read.csv("NEK7_BRCA.csv", sep = , header = TRUE)
head(df)
## NEK7 UNC45A NR3C1
## 1 13.7725 10.1443 13.0158
## 2 12.7417 10.9407 12.7186
## 3 12.7267 10.9141 12.5933
## 4 12.6931 10.6454 12.5922
## 5 12.5557 11.0752 12.5727
## 6 12.5164 9.8912 13.0979
attach(df)
plot(NR3C1, NEK7, main = "NR3C1 vs NEK7", xlab = "NR3C1", ylab = "NEK7", xlim = c(5, 15), ylim = c(5, 15), pch = 20)
abline(lm(NEK7 ~ NR3C1), col = "blue", lwd =2)
text(13,15, paste("Pearson Correlation : ", round(cor(NR3C1, NEK7), 4)), col="red")

3 Scatter Plots
par(mfrow=c(1,3))
plot(NEK7, UNC45A, main = paste("NEK7 vs UNC45A\n Pearson Correlation : ", round(cor(NEK7, UNC45A), 4) ), xlab = "NEK7", ylab = "UNC45A", xlim = c(0, 14), ylim = c(0, 14))
plot(UNC45A, NR3C1, main = paste("UNC45A vs NR3C1\n Pearson Correlation : ", round(cor(UNC45A, NR3C1), 4) ), xlab = "UNC45A", ylab = "NR3C1", xlim = c(0, 14), ylim = c(0, 14))
plot(NR3C1, NEK7, main = paste("NR3C1 vs NEK7\n Pearson Correlation : ", round(cor(NR3C1, NEK7), 4) ), xlab = "NR3C1", ylab = "NEK7", xlim = c(0, 14), ylim = c(0, 14))

layout() function
layout(matrix(c(1,1,2,3), 2, 2, byrow = TRUE))
plot(NEK7, UNC45A, main = paste("NEK7 vs UNC45A\n Pearson Correlation : ", round(cor(NEK7, UNC45A), 4) ), xlab = "NEK7", ylab = "UNC45A", xlim = c(0, 14), ylim = c(0, 14))
plot(UNC45A, NR3C1, main = paste("UNC45A vs NR3C1\n Pearson Correlation : ", round(cor(UNC45A, NR3C1), 4) ), xlab = "UNC45A", ylab = "NR3C1", xlim = c(0, 14), ylim = c(0, 14))
plot(NR3C1, NEK7, main = paste("NR3C1 vs NEK7\n Pearson Correlation : ", round(cor(NR3C1, NEK7), 4) ), xlab = "NR3C1", ylab = "NEK7", xlim = c(0, 14), ylim = c(0, 14))

layout() function with relative widths and heights
layout(matrix(c(1,1,2,3), 2, 2, byrow = TRUE), widths = c(3,1), heights = c(1,2))
plot(NEK7, UNC45A, main = paste("NEK7 vs UNC45A\n Pearson Correlation : ", round(cor(NEK7, UNC45A), 4) ), xlab = "NEK7", ylab = "UNC45A", xlim = c(0, 14), ylim = c(0, 14))
plot(UNC45A, NR3C1, main = paste("UNC45A vs NR3C1\n Pearson Correlation : ", round(cor(UNC45A, NR3C1), 4) ), xlab = "UNC45A", ylab = "NR3C1", xlim = c(0, 14), ylim = c(0, 14))
plot(NR3C1, NEK7, main = paste("NR3C1 vs NEK7\n Pearson Correlation : ", round(cor(NR3C1, NEK7), 4) ), xlab = "NR3C1", ylab = "NEK7", xlim = c(0, 14), ylim = c(0, 14))

layout() function with absolute widths and heights(cm)
layout(matrix(c(1,1,2,3), 2, 2, byrow = TRUE), widths = c(lcm(4), lcm(10)), heights = c(1,2))
plot(NEK7, UNC45A, main = paste("NEK7 vs UNC45A\n Pearson Correlation : ", round(cor(NEK7, UNC45A), 4) ), xlab = "NEK7", ylab = "UNC45A", xlim = c(0, 14), ylim = c(0, 14))
plot(UNC45A, NR3C1, main = paste("UNC45A vs NR3C1\n Pearson Correlation : ", round(cor(UNC45A, NR3C1), 4) ), xlab = "UNC45A", ylab = "NR3C1", xlim = c(0, 14), ylim = c(0, 14))
plot(NR3C1, NEK7, main = paste("NR3C1 vs NEK7\n Pearson Correlation : ", round(cor(NR3C1, NEK7), 4) ), xlab = "NR3C1", ylab = "NEK7", xlim = c(0, 14), ylim = c(0, 14))
