I am trying to do some analyses with R and experienced some problems when doing it with my Macbook. When reading the csv file in R it tells me that the numeric values are empty.
That's how it looks like when I try to run an analysis:
pall.values = numeric()
df <- data.frame(Estimate=numeric(50), P.value=numeric(50))
for (i in 2:51){ #change the column range based on your data sheet
x <- cor.test(fdata[,c(i)],fdata$ARHQ_dad)
df$Estimate[i-3]=x$estimate
df$P.value[i-3]=x$p.value
}
Then this error occurs:
Error in cor.test.default(fdata[, c(i)], fdata$ARHQ_dad) : 'x' must be a numeric vector
The csv itself recognizes the values as numbers since I used the Data to Column function and divided the columns by spaces and commas. However, in R it doesn't seem to work...
I hope somebody knows the answer to this (simple) problem.