Problem rendering plots from flexdashboard

I'm trying to plot circular data from the circular library using a shiny app within a flexdashboard. The following code works until I "Open in a Browser" or upload to our server ... then I lose the graphs ????.

---
title: "Untitled"
output: 
  flexdashboard::flex_dashboard:
    source_code: embed
runtime: shiny
---

```{r setup, include=FALSE}
library(flexdashboard)
library(circular)

data(fisherB1c)
data(wind)

windc <- circular(wind, type="angles", units="radians", template = "geographics")
```

Column {.sidebar}
--------------------------------------------------------

### Sidebar Column

```{r}
radioButtons("selection", label = h3("Make Seclection"),
             choices = list("Wind Data"="windc", 
                            "Fisher Data" = "fisherB1c"),
             selected="windc")
```

Column 
--------------------------------------------------------

### Circular Graphs

```{r}
renderPlot({
  if(input$selection == "windc"){
    plot(windc, cex=1.5, bin=720, stack=TRUE, 
         sep=0.035, shrink=1.3)
  } else {
    plot(fisherB1c, pch=16, col="blue", 
         stack=T, shrink=1.2, bins=720, ticks=T)
  }
})
```

Fixed the problem. I guess there is more to the YAML header format than I realize.

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.