R brilliant can react () function return multiple values?

I use a reactive function to do two things at the same time:

  • read the downloaded csv file;
  • get file name

see code below:

file_info<-reactive({ filename <- file.choose() data <- read.csv(filename, skip=1) file_name <- basename(filename) }) 

however, file_info () contains only the file_name, which forces me to write another reactive function to load the data:

  Raw<- reactive({ inFile <- input$file1 if (is.null(inFile)) return(NULL) Raw<-read.csv(inFile$datapath, header=TRUE ,sep=",") }) 

I think there should be another effective way to do this, well in advance for any suggestions.

+5
source share

Source: https://habr.com/ru/post/1247422/


All Articles