r - Knitr kable() output not displayed correctly when there are parenthesis in column title -


i have linear model, want print coefficient table in knitr chunk inside r markdown file. produce html file r markdown file.

> model <- lm(speed ~ dist, cars) 

this coefficient table is not displayed correctly when place in {r results='asis'} knitr chunk. table displayed plain text in html page.

> kable(xtable(model))   |            |  estimate| std. error|  t value| pr(>|t|)| |:-----------|---------:|----------:|--------:|--------:| |(intercept) | 8.2839056|  0.8743845| 9.473985|        0| |dist        | 0.1655676|  0.0174945| 9.463990|        0| 

this coefficient table is displayed correctly when place in {r results='asis'} knitr chunk. table displayed html table in html page.

> kable(data.frame(xtable(model)))   |            |  estimate| std..error|  t.value| pr...t..| |:-----------|---------:|----------:|--------:|--------:| |(intercept) | 8.2839056|  0.8743845| 9.473985|        0| |dist        | 0.1655676|  0.0174945| 9.463990|        0| 


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -