Upload only partial file r shiny

I need to allow users to upload only the first n rows of a .csv file to my shiny app.

The files I want to upload are large, and take a long time to upload, so ideally, shiny would upload only the first n rows.

I know I can read only the first nrows using read.csv or data.table::fread, but I want to upload only the first nrows using shiny::fileInput (or some similar function).

Is this possible?

Hosted example here: https://shiny.rstudio.com/gallery/file-upload.html

Code for MWE here: https://github.com/rstudio/shiny-examples/tree/master/009-upload

R works with in memory data, so your file needs to be loaded in order for R been able to manipulate it, I don't think that there is a way for a shiny app to manipulate a file that is still in the client's hard drive.

Something like that would be possible, but it'd have to be a feature of fileInput and implemented in JavaScript. We don't have plans for doing that, sorry...

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.