Remember that if you want to find out what your working directory is you can use the following command

getwd()

Installing Packages for use

We want to install a couple of packages including dplyr, readr and ggplot2, by doing the following

install.packages("dplyr")
library(dplyr)

Using data file

Next you want to download the data and asign it to a variable so that you can call upon it in the future

We can use the following calls to our view and gain knowledge of the data including:

Rather than viewing the whole data set, we can just view the first/last few rows of the data set

head(datakid)
## # A tibble: 6 x 7
##      X1   obs  time delta gender  race   age
##   <int> <int> <int> <int>  <int> <int> <int>
## 1     1     1     1     0      1     1    46
## 2     2     2     5     0      1     1    51
## 3     3     3     7     1      1     1    55
## 4     4     4     9     0      1     1    57
## 5     5     5    13     0      1     1    45
## 6     6     6    13     0      1     1    43
tail(datakid)
## # A tibble: 6 x 7
##      X1   obs  time delta gender  race   age
##   <int> <int> <int> <int>  <int> <int> <int>
## 1   858   858  2680     0      2     2    54
## 2   859   859  2935     0      2     2    20
## 3   860   860  3072     0      2     2    55
## 4   861   861  3161     0      2     2    56
## 5   862   862  3211     0      2     2    43
## 6   863   863  3304     0      2     2    52

Some basic information on the dataset is important, but you may not want to show that you ran the code, rather jsut show the information

## [1] 863   7
## [1] "X1"     "obs"    "time"   "delta"  "gender" "race"   "age"

If you want to display the graph that can identify the ages that are not included in the data set by grabbing the unique ages you can do so

qplot(unique(datakid$age), binwidth= 1)

qplot(datakid$age, datakid$time)

Including more plots

You may want to include a number of these plots but not display the code for each one

R Markdown

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.