---  
title: "Cats on the Internet"
output: html_document
---  

#### Date: `r Sys.Date( )`

### Some cats are more popular than others

Some cats are more popular than others, and the popularity of different cats changes over time. Here is a plot of the relative popularity of *grumpy cat* and *I can has cheezburger* as Google search terms since 2006. You can see that although the *I can haz cheezburger* meme and blog were popular for some years, they have now been superseded by *grumpy cat*.


```{r echo=FALSE}  

catz <- read.csv('http://www.introductoryr.co.uk/Reproducibility/catz2.csv', stringsAsFactors=FALSE)  ##Load data from Introductory R website

catz$Week <- as.Date(catz$Week)  ##Make sure dates are dates
```

## A summary of the data:

```{r echo=FALSE, comment=NA}

summary(catz)
```


## A graph of the data:

```{r echo=FALSE}

plot(catz$Week, catz$Grumpy, type= "l", xlab= "Date", ylab= "Relative popularity of search term", col= "steelblue")  #PLot graph 

points(catz$Week, catz$Cheezburger, type= "l", col= "darkred")   #Add points for cheezburger

legend("topleft", legend= c("Grumpy cat", "I can haz cheezburger"), col= c("steelblue", "darkred"), pch=16)  #Add legend
```  

Figure 1. Relative popularity of Google searches for cat-related terms over time. Even at its most popular the *cheezburger* meme and associated material were only about `r max(catz$Cheezburger)`% as popular in terms of searches per week as *grumpy cat* at its peak.
