R Markdown

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

Including Plots

You can also embed plots, for example:

## # weights:  19
## initial  value 56.605076 
## iter  10 value 41.099345
## iter  20 value 25.222224
## iter  30 value 3.702063
## iter  40 value 2.863184
## iter  50 value 2.770904
## iter  60 value 2.717774
## iter  70 value 2.708024
## iter  80 value 2.694758
## iter  90 value 2.691008
## iter 100 value 2.690512
## iter 110 value 2.690384
## iter 120 value 2.690344
## iter 130 value 2.690326
## final  value 2.690325 
## converged
##     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.