在全屏和浏览器模式下显示时,Flexdashboard发生故障

时间:2018-12-11 23:51:34

标签: r shiny flexdashboard

我在下面的flexdashboard上生成了一个数据表和一个可绘制的折线图。如您所见,最初以最小化的方式加载应用程序时,将显示整个折线图。当我尝试以全视角观看时,我丢失了一半的线条。第二个问题是,当我在浏览器中打开它时,似乎没有任何作用。除了plotly,我还尝试了ggplot2,结果相同。

---
title: "[School Name] Enrollment Projections for Fall 2019"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    runtime: shiny
---
```{r setup, include = FALSE}
library(flexdashboard)
library(shiny)
library(reshape2)
library(plotly)
library(tidyverse)
```
Column {.sidebar }
-------------------------------------
### Menu
```{r}
```

Row {data-height=400}
-------------------------------------
### Enrollments
```{r}
renderTable(mtcars)
```
Row {data-height=400}
-------------------------------------
### Enrollments
```{r}

year<-c("2000","2000","2001","2002","2000")
gender<-c("M","F","M","F","M")
YG<-data.frame(year,gender)

ns<-data.frame(YG %>%
                 group_by(year) %>%
                 count(gender) %>%
                 spread(gender, n) %>%
                 mutate_all(replace_na, 0))


plot_ly(ns, x = ~factor(year), y = ~M, name = 'Males', type = 'scatter', mode = 'lines',
        line = list(color = 'rgb(205, 12, 24)', width = 4)) %>%
  add_trace(y = ~F, name = 'Females', line = list(color = 'rgb(22, 96, 167)', width = 4)) %>%
  layout(title = "Day 10 Enrollments",
         xaxis = list(title = "Years"),
         yaxis = list (title = "Count"))
```

0 个答案:

没有答案