```{r message=FALSE}
library(dplyr)
patients <- read.delim("patient-data-cleaned.txt", stringsAsFactors = FALSE) %>% tbl_df
patients %>% head(5)
```

******

Compute the mean age, height and weight of patients in the patients dataset

- Modify the output by adding a step to round to 2 decimal places

******

```{r}
## YOUR CODE HERE
```

******

See what happens if you try to compute the mean of a logical (boolean) variable

- What proportion of our patient cohort has died?

******

```{r}
## YOUR CODE HERE
```

******

Compare the average height of males and females in this patient cohort.

Are smokers heavier or lighter on average than non-smokers in this dataset?

******

```{r}
## YOUR CODE HERE
```

******

```{r}
diabetes <- read.delim("diabetes.txt", stringsAsFactors = FALSE) %>% tbl_df
diabetes %>% head(5)
```

******

Find the number of visits made by each patient to the hospital to have blood glucose and pressure measurements taken.

Find the date of the last visit made by each patient.

Add these values as additional columns to the patients table.

- Can you do this as a single sequence of dplyr commands using the `%>%` symbol?

******

```{r}
## YOUR CODE HERE
```
