ok, sorry, I mistyped my request. this caused you to share only one of the columns of phage (the V1) rather than the whole thing. but it does reveal that for those 10 records, all values are 'pos' , which is the problematic case of the first example I shared, rather than the one that works well (the 2nd).
lets take a random sample, of pos and neg records, and test (and share that) and see what happens).
use the library(tidyverse)
pos_df<- phage%>% filter(V1=='pos')
nrow_pos <- nrow(pos_df)
rand_rows_1 <- sample.int(nrow_pos ,size=3,replace=FALSE)
pos_3<- slice(pos_df,
rand_rows_1)
neg_df<- phage%>% filter(V1=='neg')
nrow_neg <- nrow(neg_df)
rand_rows_2 <- sample.int(nrow_neg ,size=3,replace=FALSE)
neg_3<- slice(neg_df,
rand_rows_2)
shortphage <- union(pos_3,neg_3)
after preparing the shortphage you can share it like so
dput(shortphage)
I suppose you could also test it yourself
model = stepclass(V1 ~ .,data = shortphage, method = "lda", direction = "forward", criterion = "AC")
however I'd be interested to debug it for you if you could share shortphage and it does error for you.