Chapter 7

Workflow: scripts and projects

Author

Aditya Dahiya

Published

August 8, 2023

7.3 Exercises

Question 1

Go to the RStudio Tips Twitter account, https://twitter.com/rstudiotips and find one tip that looks interesting. Practice using it!

One tip that I found interesting is the use of Ctrl + Shift + P to open the R-Studio Command Palette. I have embedded the tweet here by inserting a simple HTML block, and pasting the HTML code from public.twitter.com link.

Question 2

What other common mistakes will RStudio diagnostics report? Read https://support.posit.co/hc/en-us/articles/205753617-Code-Diagnostics to find out.

Some of the common mistakes that RStudio diagnostics will report are:--

  1. It can detect if a variable named in a function has not yet been defined (i.e. the variable used has no definition in scope), or is misspelt.

  2. It can detect if a variable has been defined, but is not being used within a function.

  3. It can detect the missing punctuation, i.e. a missing comma or missing brackets.

  4. It can detect whether the call within a function can work or not, i.e., whether the arguments to a function are matched, partially matched or unmatched.

  5. It can detect if an essential argument to a function is missing.

  6. It can provide us R code style diagnostics, e.g. white-space etc.

  7. It can even detect mistakes in other languages such as C , C++ , JavaScript and Python .