In the package nnet
, the following example is given:
# or
ird <- data.frame(rbind(iris3[,,1], iris3[,,2], iris3[,,3]),
species = factor(c(rep("s",50), rep("c", 50), rep("v", 50))))
ir.nn2 <- nnet(species ~ ., data = ird, subset = samp, size = 2, rang = 0.1,
decay = 5e-4, maxit = 200)
table(ird$species[-samp], predict(ir.nn2, ird[-samp,], type = "class"))
I do not understand how this part works: species ~ .
, I understand it is some kind of formula that is passed as argument but I do not know where to search for more information about the syntax of formulaes and what the .
will represent.
Please close this question if it is a duplicate, I could not find the same question.