问题
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