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:

gilt <-read.csv("~/Desktop/CS695/GILTdata.csv")
head(gilt)
##     zip     time age product MSRP discountCat
## 1 75001 4.616667  21       1 1090         low
## 2 75001 4.616667  21       2   75         low
## 3 75001 4.616667  21       3  670         low
## 4 75001 4.616667  21       4   90         low
## 5 75001 4.616667  21       5  270         low
## 6 75001 4.616667  21       6  331         low
summary(gilt)
##       zip             time              age           product    
##  Min.   : 1040   Min.   :  2.517   Min.   :19.00   Min.   :1.00  
##  1st Qu.:27293   1st Qu.:  4.617   1st Qu.:28.00   1st Qu.:2.75  
##  Median :44866   Median :  5.950   Median :33.00   Median :4.50  
##  Mean   :49543   Mean   :  7.463   Mean   :36.16   Mean   :4.50  
##  3rd Qu.:78430   3rd Qu.:  7.812   3rd Qu.:43.00   3rd Qu.:6.25  
##  Max.   :99701   Max.   :106.150   Max.   :77.00   Max.   :8.00  
##       MSRP         discountCat 
##  Min.   :  75.00   high : 126  
##  1st Qu.:  89.75   low  :3152  
##  Median : 300.50   right: 754  
##  Mean   : 380.62               
##  3rd Qu.: 490.00               
##  Max.   :1090.00
str(gilt)
## 'data.frame':    4032 obs. of  6 variables:
##  $ zip        : int  75001 75001 75001 75001 75001 75001 75001 75001 30066 30066 ...
##  $ time       : num  4.62 4.62 4.62 4.62 4.62 ...
##  $ age        : int  21 21 21 21 21 21 21 21 52 52 ...
##  $ product    : int  1 2 3 4 5 6 7 8 2 3 ...
##  $ MSRP       : int  1090 75 670 90 270 331 89 430 75 670 ...
##  $ discountCat: Factor w/ 3 levels "high","low","right": 2 2 2 2 2 2 2 2 2 2 ...
attach(gilt)
aggregate(. ~ product, gilt[4:5], mean)
##   product MSRP
## 1       1 1090
## 2       2   75
## 3       3  670
## 4       4   90
## 5       5  270
## 6       6  331
## 7       7   89
## 8       8  430
sumplot <- aggregate(. ~ product, gilt[4:5], mean)
plot(sumplot)

Including Plots

You can also embed plots, for example:

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.