Home > Net >  How do I stop the code from showing on my R dashboards when I publish them
How do I stop the code from showing on my R dashboards when I publish them

Time:04-12

So im trying to create a dashboard however, whenever I load the dashboard there is code on the dashboard and you can only see half of the chart . I'm unsure where the error is occurring and why the dashboard looks like it does. How do I make it show only the chart is shown and not the code?

```
    title: "Untitled"
    output: 
    flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill


```{r setup, include=FALSE}

knitr::opts_chunk$set(echo = TRUE)

if (!require("pacman")) install.packages("pacman", repos = "http://cran.us.r-project.org")

p_load(tidyverse, ggthemes, magrittr, lubridate, tidyquant, gridExtra,flexdashboard, knitr, RColorBrewer, hrbrthemes, anytime, plotly)

library(flexdashboard)

Grammy <- read_csv("Grammy.csv") |> rename("Brandi Carlile" = "Brandi Carilie")


Grammy$Date <- strptime(Grammy$Date, format="%m/%d/%Y %H:%M")

Grammy <- mutate(Grammy, Date = as.Date(Grammy$Date, "%m/%d/%Y"))
Grammy$Date <-anydate(Grammy$Date)
Grammy$Date <- as.Date(Grammy$Date)

Grammy$Date<- as.Date(Grammy$Date) #convert to date
Grammylonger <- Grammy |>
  pivot_longer(cols = `Brandi Carlile`:`Silk Sonic`, names_to = "Artists", values_to = "Streams")


Page 1
=====================================  
Column {data-width=650}
-----------------------------------------------------------------------

### Chart A

```{r}
p <- ggplot(data = Grammy, aes(x=Date, y=`Brandi Carlile`))  
   geom_line() 
  geom_point()               
scale_x_date(date_breaks = "1 day", date_labels =  "%b %Y")  
scale_y_continuous(breaks=seq(3000000, 4000000, 10000))
ggplotly(p)


```

CodePudding user response:

you can add this argument to the quotation code mark

```{r warning=TRUE, include=FALSE}

```

This will hide the code and the warning message if happen

CodePudding user response:

If I'm understanding your question correctly, try setting {r echo = FALSE}

  • Related