Reputation: 11
Hi I need to create input numbers between 0 to 1 by 0.1. I named it
prior <- seq(0,1,0.10)
Now I want those numbers input in a lda function.
Lda.obj <- lda(Y~., data=liver, prior=c(1-prior,prior)
I’m new to R and only know basics. I’m still trying to figure out how to I use loops and functions. Later after I’m able to get those 10 numbers into the lda function I want to graph those points.
Upvotes: 1
Views: 47
Reputation: 2157
prior_input <- 0
Lda.obj <- c()
for (i in 1:11) {
Lda.obj[i] <- lda(Y~., data=liver, prior=c(1-prior_input, prior_input))
prior_input <- prior_input + 0.1
}
Something like this?
Upvotes: 1