I'm trying to run a lda function but i get this error. My dataset has 388 observations and 1026 variables. The column Act
has only "n" or "p", and the other columns have numbers. The code is:
dat<-bbb.fingerprints
head(dat)
N<-nrow(dat)
smp<-sample(1:N, N/3)
smp
train<-dat[-smp, ]
test<-dat[smp, ]
library(MASS)
lda.model <- lda(Act ~ . , data=train)
View(lda.model)
The error is:
Error in lda.default(x, grouping, ...) :
variables 18 21 29 39 55 56 59 70 94 104 114 138 150 162 184 199 205 248 268 371 374 383 443 444 450 451 515 535 537 538 554 583 606 619 620 628 636 646 649 655 720 733 756 757 784 798 806 846 849 852 860 867 908 939 978 987 996 1000 1001 appear to be constant within groups
Can you help me pleaseeee?