This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
library(nnet)
# iris3 is iris rearranged so that iris3[,,1] is setosa only, etc.
# Thus, iris[,,1] is a 2 x 2 matrix. Constructing the rbind of the 3 stacks the 3 species on top of one another.
ir <- rbind(iris3[,,1], iris3[,,2], iris3[,,3])
targets <- class.ind( c(rep("s",50), rep("c",50),rep("v",50)))
summary(ir)
## Sepal L. Sepal W. Petal L. Petal W.
## Min. :4.300 Min. :2.000 Min. :1.000 Min. :0.100
## 1st Qu.:5.100 1st Qu.:2.800 1st Qu.:1.600 1st Qu.:0.300
## Median :5.800 Median :3.000 Median :4.350 Median :1.300
## Mean :5.843 Mean :3.057 Mean :3.758 Mean :1.199
## 3rd Qu.:6.400 3rd Qu.:3.300 3rd Qu.:5.100 3rd Qu.:1.800
## Max. :7.900 Max. :4.400 Max. :6.900 Max. :2.500
You can also embed plots, for example:
## # weights: 19
## initial value 55.769574
## iter 10 value 36.132324
## iter 20 value 25.378680
## iter 30 value 24.317993
## iter 40 value 19.622602
## iter 50 value 18.104877
## iter 60 value 17.714485
## iter 70 value 17.594767
## iter 80 value 17.294677
## iter 90 value 5.774980
## iter 100 value 3.646901
## iter 110 value 3.385399
## iter 120 value 2.920778
## iter 130 value 2.687490
## iter 140 value 2.611542
## iter 150 value 2.571300
## iter 160 value 2.550318
## iter 170 value 2.541836
## iter 180 value 2.538591
## iter 190 value 2.537080
## iter 200 value 2.536313
## final value 2.536313
## stopped after 200 iterations
## cres
## true 1 2 3
## 1 24 0 1
## 2 0 25 0
## 3 0 0 25
Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.