Closed antoine4ucsd closed 1 year ago
You may have something in your document that is changing the default format for kable()
- this should output markdown
> knitr::kable(head(iris), caption = "An example table caption.")
Table: An example table caption.
| Sepal.Length| Sepal.Width| Petal.Length| Petal.Width|Species |
|------------:|-----------:|------------:|-----------:|:-------|
| 5.1| 3.5| 1.4| 0.2|setosa |
| 4.9| 3.0| 1.4| 0.2|setosa |
| 4.7| 3.2| 1.3| 0.2|setosa |
| 4.6| 3.1| 1.5| 0.2|setosa |
| 5.0| 3.6| 1.4| 0.2|setosa |
| 5.4| 3.9| 1.7| 0.4|setosa |
The default format can be changed by option knitr.table.format
and seems to have been set for html
for your session.
Do you use kableExtra for example ? It can do that I think when you load it.
not sure if this is related but I also get this kind of errors:
This is an error from reticulate which is not finding your python correctly. reticulate is used when you are using Python in your Rmd document.
thank you for the quick reponse! I only set the following in my code
knitr::opts_chunk$set(echo = T,message=FALSE )
I did not load kableExtra. However, if I open a new session of R and only type your example, it seems to work well. if I install the pal package, it gives me the following
> pal::knitr_table_format('simple')
[1] "html"
what would you recommend? thank you
this works!
options(knitr.table.format = "simple")
thank you
You can also pass to the to the format
argument in the function.
Also I don't know about the pal package but they probably are doing the same as kableExtra and change the default at loading time.
I'll close this as you know how to change now
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.
Hello I am having issues with kable on my mac . the output is not really what I would expect. not sure how to explain it. for example. If I run
I would expect
but I got
not sure if this is related but I also get this kind of errors:
all advices are welcome! thank you