I am loading in a large data file using fread which is from: library(data.table). fread by default shows the status of how long it is taking to read in the file but it only prints to the console.
I would like to capture the loading time of data and display it in real time in the shiny application so the user understands why there is a delay and roughly how long the data read is taking. I would like to use withProgress since this produces a loading bar and you can display text defining what the program is doing.
Typically, withProgress is incremented by a numeric scale using incProgress, however, I am looking for a way to do something like this:
withProgress(message = 'Loading Data', {
d <- fread("file_name.csv") # Pick a random (large) file to load
})
The problem with the above code is that the load bar isn't being incremented (I don't think that withProgress detects the loading by fread automatically). The load bar shows up and only increments a small amount but it is not correctly capturing the loading time from fread.
Update
I was able to find this similar question, however, the only answer given to this question uses the loading bar to indicate the progress of loading many files (Loaded 2 of n files). My problem is trying to show the progression of reading in a single large file.
I know fread knows how many rows a file contains after the initial scan because in the console it does show the progress. I just need to know how to tap into that to use it in the progress bar.
Here is an example of how fread displays the read in progress:

fread Documentation
If you look up the documentation for fread this is what it says about the built in showProgess option:
TRUE displays progress on the console using \r.
It is produced in freads C code where the very nice (but R level)
txtProgressBar and tkProgressBar are not easily available.
showProgress = getOption("datatable.showProgress") # default: TRUE