0
df_scaled <- as.data.frame(scale(df))
features <- df_scaled[, -10]
target <- df_scaled[, 10]
pc <- PCA(features, graph = FALSE)
print(pc)

Error in eigen(crossprod(t(X), t(X)), symmetric = TRUE) :0х0 matrix

where is the error?

I have 19178 obs. of 29 variables, so it is strange that the program does not work

Phil
  • 7,287
  • 3
  • 36
  • 66
  • Hello Victoria, must share a sample of data for the problem to be reproducible. What `summary(features)` returns? – Ric Apr 29 '23 at 11:42
  • Hello, Ric! age height_cm weight_kg overall potential Min. : NA Min. : NA Min. : NA Min. : NA Min. : NA 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA Median : NA Median : NA Median : NA Median : NA Median : NA Mean :NaN Mean :NaN Mean :NaN Mean :NaN Mean :NaN 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA Max. : NA Max. : NA Max. : NA Max. : NA Max. : NA (summary(features)) returns this – Victoria Apr 29 '23 at 11:49
  • all your data is NA. Review your `df`. Perhaps all columns are text columns or similar – Ric Apr 29 '23 at 14:05

0 Answers0