If your R
script uses senstive information such as a password, then it's best to keep this in a seperate file (and perhaps outside the project's repository). Moreover, if you're giving a live demo using RStudio, then you should avoid putting this senstive information in your global environment.
If you put it in a YAML file, say .my_project.yaml
, which may look as follows:
---
api_service:
username: foo
password: bar123!