The profvis package provides tools for helping you to understand how R spends its time. It provides a interactive graphical interface for visualizing data from Rprof, R’s built-in tool for collecting profiling data.
The profvis homepage provides an extensive instructions for working with this package, as well as an example on specifically profiling a Shiny app.