I created a correlation of several variables in R.
df <- read_excel("~/R/Track/Cumulative_2023.xlsx")
Rel <- cor(df[, c('Speed', 'Axis', 'Horz', 'Ext', 'Zone', 'Rel')], use="complete.obs")
I am using the code:
W <- write.xlsx(Rel, file = "~/R/Track/correlation.xlsx", sheetName = "Sheet1", colNames = TRUE, rowNames = TRUE)
When I run W I get a spreadsheet that has the number 1 in the 1st row/column. I can't figure it out. If I write.xls using the df variable instead of Rel, it writes it properly.
I should be able to export the Rel variable with no issues right?
I was expecting to export the Rel variable to Excel.