0

I'm trying to train my data of gene expression based on cancer Recurrence(R) or Non-Recurrence(NR). My dataset that I'm working on :

dim(all_C) [1] 87 11

87 samples and 10 Genes(a column is called "Condition", which shows that each sample is R or NR. I used these commands:

trainset <- sapply(unique(all_C$Condition), function (S) sample(which(all_C$Condition==S), 20))

trainset <- as.numeric(trainset)

table(all_2[trainset, "Condition"])

testset <- setdiff(seq(87),trainset)

any(testset %in% trainset)

library(MASS)

model.lda <- lda(all_C[trainset,-11] , grouping = all_C[trainset,11] )

predict.lda <- predict(model.lda , all_C[testset, 1:10])

But I get this error:

Error in FUN(x, aperm(array(STATS, dims[perm]), order(perm)), ...) : non-numeric argument to binary operator

Would you help me, please?

  • 1
    It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Feb 05 '22 at 20:07
  • Please provide enough code so others can better understand or reproduce the problem. – Community Feb 12 '22 at 01:10

0 Answers0