In the RStudio (aka Posit) menu bar, notice the Debug and Profile drop-down menus. Take some time to play around with these -- especially the Profile drop-down menu. These are quick starting points for finding code bugs/bottlenecks. Studying the below chapters will give insight into finding where and how to improve code efficiency.
@UofUEpiBio/phs7045-2023 -- Week 4 material
In the RStudio (aka Posit) menu bar, notice the
Debug
andProfile
drop-down menus. Take some time to play around with these -- especially theProfile
drop-down menu. These are quick starting points for finding code bugs/bottlenecks. Studying the below chapters will give insight into finding where and how to improve code efficiency.Primary reading:
Norman Matloof's Ch. 13.1-13.3.5: Debugging and Hadley Wickham's Ch. 23: Measuring Performance and Ch. 24: Improving Performance.
Supplemental reading:
Matloof Ch. 14: Performance Enhancement: Speed and Memory is slightly outdated by recommending
RProf
to measure performance (as compared toprofvis
used in RStudio and highlighted in Ch. 24: Improving Performance) but has good content on speed and memory allocation.