The goal of screenshots is to ...
You can install the development version of screenshots like so:
remotes::install_github('iNZightVIT/screenshot')
This is a basic example which shows you how to solve a common problem:
library(screenshots)
## basic example code
capture("current-window")