Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R gvisGeoMap+;闪亮的+;代表_R_Rstudio_Shiny_Googlevis - Fatal编程技术网

R gvisGeoMap+;闪亮的+;代表

R gvisGeoMap+;闪亮的+;代表,r,rstudio,shiny,googlevis,R,Rstudio,Shiny,Googlevis,我正在尝试使用新的R presentations+shiny+gvisGeoMap创建交互式幻灯片 这就是我现在拥有的: --- title: "Untitled" author: "Name1" date: "06/25/2014" output: ioslides_presentation runtime: shiny --- ## Slide with Interactive Plot ```{r, echo=FALSE} suppressPackageStartupMessages

我正在尝试使用新的R presentations+shiny+gvisGeoMap创建交互式幻灯片

这就是我现在拥有的:

---
title: "Untitled"
author: "Name1"
date: "06/25/2014"
output: ioslides_presentation
runtime: shiny
---


## Slide with Interactive Plot

```{r, echo=FALSE}
suppressPackageStartupMessages(require(googleVis))
inputPanel(
  selectInput("select", 
        label = "Select G1 or G2",
        choices = list("G1", "G2"),
        selected = "G1")
)

renderPlot({
  if(input$select=="G1"){
    G1 <- gvisGeoMap(Exports, locationvar='Country', numvar='Profit',
                 options=list(dataMode="regions")) 

    plot(G1)
  }else{
    G2 <- gvisGeoMap(CityPopularity, locationvar='City', numvar='Popularity',
                 options=list(region='US', height=350, 
                              dataMode='markers',
                              colors='[0xFF8747, 0xFFB581, 0xc06000]')) 
    plot(G2)
  }

})
```
---
标题:“无标题”
作者:“姓名1”
日期:“2014年6月25日”
输出:ioslides\u演示文稿
运行时间:闪亮
---
##带互动情节的幻灯片
```{r,echo=FALSE}
SuppressPackageStatupMessages(需要(谷歌视讯))
输入面板(
选择输入(“选择”,
label=“选择G1或G2”,
选项=列表(“G1”、“G2”),
已选择=“G1”)
)
渲染图({
如果(输入$select==“G1”){

G1
googleVis
绘图使用
renderGvis
函数。您需要传递
googleVis
对象,而不是调用
plot
。 需要将
renderGvis
分配给输出,并使用
htmlOutput

---
title: "Untitled"
author: "Name1"
date: "06/25/2014"
output: ioslides_presentation
runtime: shiny
---


## Slide with Interactive Plot

```{r, echo=FALSE}
suppressPackageStartupMessages(require(googleVis))
inputPanel(
  selectInput("select", 
        label = "Select G1 or G2",
        choices = list("G1", "G2"),
        selected = "G1")
)

output$test <- renderGvis({
  if(input$select=="G1"){
    G1 <- gvisGeoMap(Exports, locationvar='Country', numvar='Profit',
                 options=list(dataMode="regions", width="100%")
                 , chartid = 'mychart') 

    G1
  }else{
    G2 <- gvisGeoMap(CityPopularity, locationvar='City', numvar='Popularity',
                 options=list(region='US', height=350, width="100%", 
                              dataMode='markers',
                              colors='[0xFF8747, 0xFFB581, 0xc06000]'
                              ), chartid = 'mychart') 
    G2
  }

})
htmlOutput("test")

```
---
标题:“无标题”
作者:“姓名1”
日期:“2014年6月25日”
输出:ioslides\u演示文稿
运行时间:闪亮
---
##带互动情节的幻灯片
```{r,echo=FALSE}
SuppressPackageStatupMessages(需要(谷歌视讯))
输入面板(
选择输入(“选择”,
label=“选择G1或G2”,
选项=列表(“G1”、“G2”),
已选择=“G1”)
)

output$test奖金问题:有没有办法使贴图自动调整大小以避免有这么多空白?将
width=“100%”
声明为一个选项