Thanks again for your replies. I initially thought that when my script successfully ran library(plotly) (after installing it, if necessary), it meant that whatever plotly might need (like pandoc) was available. I saw that plotly imports htmlwidgets, which is what uses pandoc.
Your mention of packrat and dependencies has me wondering: Did my packagename::functionname() syntax do some sort of end-run around the full htmlwidgets installation? Could I avoid this "runs in RStudio but not R" problem by avoiding that packagename::functionname() syntax?
You mention installing packages with their System Requirement. If I install a package (e.g., htmlwidgets), are the system requirements automatically installed, or do I need to do that separately? Does something tell me what a package's system requirements are? Maybe that's a path I can travel toward a solution - I could define the set of packages my group uses, and make sure all the server and laptops have all of their system requirements.
Still, it seems a shortcoming of RStudio to include, by default, resources that are not in the default R installation yet might be used in R scripts, and not document those differences. If a dev tool is so user-friendly that it lets things run that won't run in prod, it should list the differences someplace obvious.