Chapter 7
Workflow: scripts and projects
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.
Access it with Ctrl + Shift + P (Windows / Linux) or Cmd + Shift + P (macOS)!#rstats https://t.co/pWAYHGCWRr
— RStudio Tips (@rstudiotips) October 26, 2022
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:--
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.
It can detect if a variable has been defined, but is not being used within a function.
It can detect the missing punctuation, i.e. a missing comma or missing brackets.
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.
It can detect if an essential argument to a function is missing.
It can provide us
R
code style diagnostics, e.g. white-space etc.It can even detect mistakes in other languages such as
C
,C++
,JavaScript
andPython
.