|
|
|
|
|
|
|
|
|
|
|
--- |
|
|
|
|
|
output: github_document |
|
|
|
|
|
--- |
|
|
|
|
|
|
|
|
|
|
|
```{r setup, include=FALSE} |
|
|
|
|
|
knitr::opts_chunk$set(eval = FALSE) |
|
|
|
|
|
|
|
|
|
|
|
github_sha_link <- function(sha) { |
|
|
|
|
|
glue::glue("") |
|
|
|
|
|
} |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Building a Shiny Input |
|
|
|
|
|
|
|
|
|
|
|
In this project, |
|
|
|
|
|
we're going to create a typing speed app |
|
|
|
|
|
using a custom Shiny input. |
|
|
|
|
|
The app will give users typing prompts, |
|
|
|
|
|
monitor their typing speed, |
|
|
|
|
|
and use a Frappe Chart line chart |
|
|
|
|
|
to show their speed over time as they type. |
|
|
|
|
|
|
|
|
|
|
|
## Setup a folder for our app inside the frappeCharts package |
|
|
|
|
|
|
|
|
|
|
|
`r github_sha_link("63174e128861b0dbc9d77c2e35ad88e1853aa0be")` |
|
|
|
|
|
|
|
|
|
|
|
Create the directory `inst/shiny-input-app` and add `app.R` and `typing.js`. |
|
|
|
|
|
|
|
|
|
|
|
```{r} |
|
|
|
|
|
usethis::use_directory("inst/shiny-input-app") |
|
|
|
|
|
file.create("inst/shiny-input-app/app.R") |
|
|
|
|
|
file.create("inst/shiny-input-app/typing.js") |
|
|
|
|
|
``` |
|
|
|
|
|
|