I have a sample RMD below. When using render
from rmarkdown package, I get an error:
Quitting from lines 25-27 (TRY1.Rmd)
Error in select(., UID, Homework_10, Exam_3, Section) :
unused arguments (UID, Homework_10, Exam_3, Section)
while when i use the knit to html
button, it works. What might be the issue? This question is related to this one but the other question is unanswered. Tried the few suggestions to no avail. Note that the dataframe gradebook
contains very many variables. Thanks for your help
---
title: uuu
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
library(dplyr)
```
```{r}
set.seed(1)
gradebook <- data.frame(
UID = sample(100000000:999999999, size = 150, replace = FALSE),
Homework_10 = sample(0:100, size = 150, replace = TRUE),
Exam_3 = sample(0:100, size = 150, replace = TRUE),
Section = c(rep('A',times = 80),rep('B', times = 70)))
```
```{r}
gradebook[c(1,2,3,81,82,83),] %>%
select(UID, Homework_10, Exam_3, Section)
```