-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path2023-03-23_Analysis.R
33 lines (26 loc) · 1011 Bytes
/
2023-03-23_Analysis.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
library('tidyverse')
library('skimr')
library('ggplot2')
library('corrplot')
physCycles <- read.csv("2023-03-23_PhysiologicalCycles.csv", header=TRUE)
head(physCycles)
numerical_data <- physCycles[, c(4:12, 15:25)]
names(numerical_data) <- c("Recovery Score", "Resting Heart Rate", "Heart Rate Variability", "Skin Temp", "Blood Oxygen", "Day Strain", "Calories Burned", "Max Heart Rate", "Average Heart Rate", "Sleep Performance", "Respiratory Rate", "Asleep Duration", "In Bed Duration", "Light Sleep Duration", "Deep Sleep Duration", "REM Duration", "Awake Duration", "Sleep Need", "Sleep Debt", "Sleep Efficiency")
correlation <- round(cor(numerical_data, use = "complete.obs"),2)
png("PhysCycleCorrelationPlot.png", res=300, width=1000, height=1000)
corrplot(
correlation,
method = "color",
order = "FPC",
type="full",
diag=TRUE,
tl.srt=45,
tl.col="black",
tl.cex = 0.2,
cl.cex = 0.4,
sig.level = 0.15,
addCoef.col = "black",
number.digits = 2,
number.cex = 0.2
)
dev.off()