Skip to content

Instantly share code, notes, and snippets.

@HeidiSeibold
Created October 22, 2017 07:04
Show Gist options
  • Save HeidiSeibold/874d64b88850f84eb1eb799144c08895 to your computer and use it in GitHub Desktop.
Save HeidiSeibold/874d64b88850f84eb1eb799144c08895 to your computer and use it in GitHub Desktop.
Reprex for learnr issue: setup Error: Your code ran longer than the permitted time limit for this exercise.
---
title: "Tutorial"
output: learnr::tutorial
runtime: shiny_prerendered
---
```{r setup, include=FALSE}
library(learnr)
```
## Topic 1
To load the packages run:
```{r}
library("xlsx")
library("foreign")
```
## Topic 2
Now we can read the data:
```{r read_show, eval=FALSE}
# read results data
results <- read.csv("https://raw.githubusercontent.com/school-of-data/r-consortium-proposal/master/material/lessons/results.csv", header = TRUE)
# read demographic data
demographic1 <- read.xlsx("demographics1.xlsx", sheetIndex = 1)
demographic2 <- read.dta("demographics2.dta")
```
```{r read}
# read results data
results <- read.csv("https://raw.githubusercontent.com/school-of-data/r-consortium-proposal/master/material/lessons/results.csv", header = TRUE)
# download data
download.file("https://github.com/school-of-data/r-consortium-proposal/blob/master/material/lessons/demographics1.xlsx?raw=true", destfile = "demographics1.xlsx")
download.file("https://github.com/school-of-data/r-consortium-proposal/blob/master/material/lessons/demographics2.dta?raw=true", destfile = "demographics2.dta")
# read demographic data
demographic1 <- read.xlsx("demographics1.xlsx", sheetIndex = 1)
demographic2 <- read.dta("demographics2.dta")
```
## Topic 3
Check out the names of the results data.frame.
```{r ex_look1, exercise=TRUE, exercise.setup = "read"}
```
```{r ex_look1-solution}
names(results)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment