Loading files and displaying necessary features as per files loaded

三世轮回 提交于 2020-01-16 08:08:52

问题


I have a small application, where in I need to load csv files. There are couple of files in my folder say(File1.csv, File2.csv, File3.csv). The moment I load them one by one in R application. I may require following things (Is it possible to achieve this ?) If so can anyone please help me

Scenario 1 : 1) The moment I load File1 data. A rhandsontable should be displayed showing File1 is loaded like shown below

2) A renderText displaying "There are 1 no of files" 3) In case I do not need this data, A action button to unload the dataset. So once the data is unloaded the above rhandsontable should displayed none like below

Scenario 2 : 1) The moment I load File2 data (Keeping File1 data). A rhandsontable should be displayed showing File2 is loaded like shown below

2) A renderText displaying "There are 2 no of files" (In case if File1 is not there, it should be 1 3) In case I do not need this data, A action button to unload the dataset

For all the above requirements I have added necessary features but not able to code in server

---
title: "Untitled"
runtime: shiny
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
---

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

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

### Chart A

```{r}

fileInput("datafile","Choose the csv file",multiple = TRUE, 
                                            accept = c("text/csv","text/comma-separated-values,text/plain",".csv"))
actionButton("a","Unload previous dataset",icon = NULL)
```

### Chart A

```{r}
renderText("There are xx no of files")
```

来源:https://stackoverflow.com/questions/59232900/loading-files-and-displaying-necessary-features-as-per-files-loaded

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!