Profvis works in console but trying to do the same via terminal command profvis requires the code to be inside profvis({ })
Console method that works:
p <- profvis::profvis({source(myscript.R})
print(p) # gives flame/data output htmlwidgets::saveWidget(p, "profile.html") # saved profile.html with flame/data output
Terminal (not successful) -- this runs the script okay but does not save the profiler output. What can I try?
Rscript -e "p <- profvis::profvis({source('myscript.R')});
htmlwidgets::saveWidget(p,"profile.html")"
Also tried but it saved what the code does and not the profiler flame/data result
Rscript -e "profvis::profvis({source('myscript.R')})" > profile.html
Rscript -e "profvis::profvis({source('myscript.R')})" > profile.Rprofvis
Expecting to save profiler flame/data output