In the last 3 days something has happened to RMarkdown. When rendering the default .rmd file produced by RStudio to a PDF file, the plot created has no margins beyond the plot axes and the axis scales and titles are not visible. When rendering to .html, the figures are as they should be. Today I reinstalled R and RStudio and updated all of the libraries (update.packages()) and the problem remains. This first cropped up in a bookdown project so I checked the .png files that bookdown produces and they all have the same problem - no axis scales or titles and the axis margins are at the figure limits.
 "R version 4.1.3 (2022-03-10)"