简体   繁体   中英

R Markdown Error in inherits(x, "list) object not found

Good Morning! In an R Markdown chunk, I am trying to use kable to spit out a table in rmarkdown. Here's my dummy data:

whytheerror <- data.frame(name=c('school1','school2','school3','school4','school5','school6','school7','school8','school9','school10','school11'), count=c(13,25,36,44,58,63,76,85,93,78,101), percent=c(.7,.6,.2,.32,.41,.44,.97,.02,.31,.5,.11), other_count=c(15,111,33,74,19,5,3,111,1,37,501), other_percent=c(.4,.6,.3,.39,.45,.5,.02,.4,.06,.64,.11))

Here's my code:

```{r echo = FALSE, results = 'asis'}
kable(whytheerror [1:12, ], caption = "Respondent Breakdown")
```

and the error reads:

Error in inherits(x,"list"): object 'whytheerror ' not found calls: <Anonymous>...withCallingHandlers -> withVisible  -> eval  -> eval  -> kable  -> inherits

I'm having difficulty figuring out what this error means much less fixing it. can someone assist with either or both?

thank you

This

---
title: "Test"
output: html_document
---

```{r}
whytheerror <- data.frame(name=c('school1','school2','school3','school4','school5','school6','school7','school8','school9','school10','school11'), count=c(13,25,36,44,58,63,76,85,93,78,101), percent=c(.7,.6,.2,.32,.41,.44,.97,.02,.31,.5,.11), other_count=c(15,111,33,74,19,5,3,111,1,37,501), other_percent=c(.4,.6,.3,.39,.45,.5,.02,.4,.06,.64,.11))
```

```{r echo = FALSE, results = 'asis'}
library(knitr)
kable(whytheerror[1:11, ], caption = "Respondent Breakdown")
```

produces

在此处输入图片说明

No error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM