rstudio / rmarkdown

Dynamic Documents for R
https://rmarkdown.rstudio.com
GNU General Public License v3.0
2.88k stars 975 forks source link

Keeping `md` source no longer renders tables correctly in github #746

Closed chendaniely closed 8 years ago

chendaniely commented 8 years ago

Data frame outputs used to not be converted into a markdown table in the md file. However, now GitHub does not see the output as a table, and renders the raw text

selection_002

selection_003

the difference between the code is basically one is raw output, the other is wrapped in a div. should the CSS be embedded in the md output?

-```
 -## # A tibble: 6 x 3
 -##         date cases searches
 -##       <time> <dbl>    <dbl>
 -## 1 2004-01-01    98   -0.649
 -## 2 2004-02-01    41   -0.645
 -## 3 2004-03-01    53   -0.369
 -## 4 2004-04-01    92   -0.485
 -## 5 2004-05-01   100    0.188
 -## 6 2004-06-01   240   -0.036
 -```
 +<div class="kable-table">
 +
 +date          cases   searches
 +-----------  ------  ---------
 +2004-01-01       98     -0.649
 +2004-02-01       41     -0.645
 +2004-03-01       53     -0.369
 +2004-04-01       92     -0.485
 +2004-05-01      100      0.188
 +2004-06-01      240     -0.036
 +
 +</div>
jjallaire commented 8 years ago

Is this with the current master of rmarkdown? We did change the default rendering behavior for a day or two but switched it back recently to using standard printing by default.

chendaniely commented 8 years ago

i'm using: rmarkdown_1.0.2

> library(rmarkdown)
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Antergos Linux

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rmarkdown_1.0.2 useful_1.2.1    ggplot2_2.1.0   glmnet_2.0-5    foreach_1.4.3   Matrix_1.2-6    dplyr_0.5.0    
[8] lubridate_1.5.6 readr_0.2.2    

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.6      knitr_1.13       magrittr_1.5     munsell_0.4.3    colorspace_1.2-6 lattice_0.20-33 
 [7] R6_2.1.2         stringr_1.0.0    plyr_1.8.4       tools_3.3.1      grid_3.3.1       gtable_0.2.0    
[13] DBI_0.4-1        htmltools_0.3.5  iterators_1.0.8  digest_0.6.9     lazyeval_0.2.0   assertthat_0.1  
[19] tibble_1.1       codetools_0.2-14 rsconnect_0.4.3  evaluate_0.9     labeling_0.3     stringi_1.1.1   
[25] scales_0.4.0 
jjallaire commented 8 years ago

Could you try installing the latest version from GitHub to see if it fixes the problem:

devtools::install_github("rstudio/rmarkdown")
chendaniely commented 8 years ago

yep, that fixed it.

Thank you!

jjallaire commented 8 years ago

Great!

github-actions[bot] commented 4 years ago

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.