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?