在使用带串扰的DT和传单包之后,从Datable导出CSV文件

时间:2019-01-17 06:41:47

标签: r leaflet dt flexdashboard react-leaflet

下面是我的数据集。我正在尝试使用leafletDT中使用flexdashboardcrosstalk。我可以使用以下脚本在flexdashboard中运行数据。现在,我正在寻找无法在leaflet部分创建全屏选项。我的目的是在传单上选择数据,并将所选数据反映到DT表中,目前正在工作。但我想将所选数据导出到CSV文档中?我无法做到。请帮忙 !

Date Hour Descr lat lng Final.Assessment 1/6/16 13 Paid -37.81550 145.0128 Paid in person 1/6/16 13 Paid -37.81550 145.0128 Paid in person 1/6/16 13 upaid -37.81550 145.0128 Not in contact 1/6/16 16 Paid -37.81760 144.9920 Paid in person 1/6/16 17 Paid -37.81127 144.9963 Paid via Online 1/6/16 17 loss -37.81127 144.9963 Bad product sold

我的flexdashboard脚本

`--- 标题:“连接地图和DT” 输出:   flexdashboard :: flex_dashboard:

输出:html

library(leaflet)
library(tidyverse)
library(dplyr)
library(crosstalk)
library(flexdashboard)
library(DT)
library(htmlwidgets)
library(htmltools)


列{data-width = 650}

图表A

newdata<-read.csv("Stackoverflow.csv")


shared_df<-SharedData$new(newdata)


leaflet(shared_df) %>% 
       addTiles() %>% 
        addMarkers()

列{data-width = 500}

图表B

datatable(shared_df)
datatable(shared_df, extensions="Scroller", style="bootstrap", class="compact", width="100%", 
options=list(deferRender=TRUE, scrollY=300,scroller=TRUE, buttons = c('copy', 'csv', 'excel', 'pdf', 'print')))

`

0 个答案:

没有答案