-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.Rmd
More file actions
31 lines (24 loc) · 1.6 KB
/
README.Rmd
File metadata and controls
31 lines (24 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
---
title: "Baby names"
output: github_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
A R shiny app showing baby names trends in Scotland since 1974. Go to [the app](https://scotland.shinyapps.io/nrs-baby-names/).
[](https://www.repostatus.org/#active)

## How it works
Tidy up the user input and split into a vector of valid names. Plot these names and display a list of similar names by [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance). Each of these similar names is an `ActionLink` that updates the plot.
## How to update
1. Make a copy of the most recent files
1. Update the CSV file
* Check for names that contain characters that aren't letters, dashes or apostrophes (regex: `[^A-Za-z'-]`)
* User input is split by these characters in `server.R` (e.g. commas and spaces)
1. Update the code
* `tickvals` in the plot
1. Create a [feather file](https://blog.rstudio.com/2016/03/29/feather/) from the CSV file
* There is a script for this
* This format is used to reduce the load time of the app. In future the data could be uploaded to statistics.gov.scot. This would allow the app to use the API instead.
## Licence
This repository is available under the [Open Government Licence v3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).