How do I create R Markdown HTML doc?

Hello All,

I am trying to create a R Markdown HTML document with code chunks to show my code is reproducible and allow anyone to practice the code on their own.

When I select the Knit to HTML this is the error code that is returned:

processing file: Cyclistic-Bikes-Deliverable.rmd
  |......................                              |  43% [unnamed-chunk-2]
Quitting from lines 30-31 [unnamed-chunk-2] (Cyclistic-Bikes-Deliverable.rmd)
                                                                                                            
Error in `.External2()`:
! unable to start data viewer
Backtrace:
 1. utils::View(dataset2)
Execution halted

Does anyone know how to generate the document, I am not sure why I am getting this message?

KInd Regards,

Likely the problem is that View doesn't make any sense in a Markdown document. View opens a window...you want something that goes into the document.

1 Like

Thanks, that was it! How else can I show the dataset table in the Markdown? I still wanted the audience to what I am working with.

Look at the kable function.

Something like this?

---
title: "Opus Meum"
author: "john the toucanite"
date: "`r Sys.Date()`"
output: html_document
---

```{r mydata}

dat1 <- data.frame(aa = 1:5, bb = 5:1)
dat1

Or you could do something like
library(flextable)
dat1 <- data.frame(aa = 1:5, bb = 5:1)
flextable(dat1)

Which gives you a bit nicer output,
1 Like

Thank you I will look into that!

Oh right, that's a great idea, I add that line of code as well, Thank you much!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.