Use pacman library as shown in the first block to install and load any list of library packages you use. you can copy and use this type of code in the beginning of all your future R scripts.
Start your block with the highlighted code to clarify this is your initial setup and no data analysis is part of this block yet
In this example, my library packages are: tidyverse, dplyr (for routine R operations) and plotly (for an interactive visualization in next steps).
Now we are done for the automatics installation of packages. Rest of code are for a simple yet elegant and handy interactive visualization.
Full guide and explanations in a complementary video tutorial here:
- code script template solution for this video available in this GitHub repo: https://github.com/winswithdata/Start_R
- in this code, you will see more in-depth explanation steps, which are explained in this complementary blog: https://winswithdata.com/?p=126