Skip to content
Snippets Groups Projects
Commit 8b8e8a9d authored by Ben Anderson's avatar Ben Anderson
Browse files

amended summary stats to include all data before keeping only UK

parent 7dbc2b25
No related branches found
No related tags found
No related merge requests found
......@@ -101,11 +101,24 @@ Loading and processing `r efile`.
system.time(
mtusEpsDT <- as.data.table(read.spss(efile))
)
```
We have loaded `r format(nrow(mtusEpsDT), big.mark=",",scientific=FALSE)` rows of data for `r format(uniqueN(mtusEpsDT$countrya), big.mark=",",scientific=FALSE)` countries.
```{r basicStats}
kable(caption = "Number of diaries per year",
table(droplevels(mtusEpsDT$countrya), # removes unused countries
mtusEpsDT$survey)
)
```
```{r keepUKOnly}
mtusUKEpsDT <- subset(mtusEpsDT, countrya == "United Kingdom")
```
# keep UK only
mtusUKEpsDT <- mtusEpsDT[countrya == "United Kingdom"]
mtusEpsDT <- NULL
We now delete the non-UK data leaving us with `r format(nrow(mtusUKEpsDT), big.mark=",",scientific=FALSE)` rows of survey data.
```{r setKeys}
# This works but we'll create a concatenated id to make life easier
setkey(mtusUKEpsDT, countrya, survey, swave, msamp, hldid, persid, id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment