Generate a string for the standard pacman script header that, when added to scripts, will ensure pacman is installed before attempting to use it. pacman will attempt to copy this string (standard script header) to the clipboard for easy cut and paste.
The script header takes the form of:
if (!require("pacman")) install.packages("pacman"); library(pacman)
This can be copied to the top of scripts to make it easy to run scripts if
the user shares them with others or to aid in long term script management.
This may also be useful for blog posts and R help sites like
StackOverflow. In this
way functions like
p_load can be used without fear that others don't
have pacman installed.
Returns a script header string (optionally copies to the clipboard).