Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DT package not working with blogdown using hugo-future-imperfect theme

Tags:

r

r-markdown

hugo

I have a blogdown site based on the hugo-future-imperfect theme where a DT output is created correctly in the rmd but the data is not shown (although the headings are) when applying serve_site/build_site

I have created two brand new sites ( so with no other complications) to illustrate the issue. This is the code and outputs

```{r DT}
library(DT)
library(tidyverse)

iris %>% 
  datatable()
```

a) default theme defaulttheme

b) hugo-imperfect imperfecttheme

like image 713
pssguy Avatar asked Apr 24 '17 17:04

pssguy


1 Answers

You can use the package widgetframe.

Install the package, then save your datatable in a variable.

install.packages("widgetframe")

ts <- iris %>% DT::datatable()

So when you want to display the datatable, just do it:

widgetframe::frameWidget(ts)

That works for me!

like image 123
igorkf Avatar answered Oct 02 '22 14:10

igorkf