1. Check R Version In Rstudio

R is a computer language. It’s a tool for doing the computation and number-crunching that set the stage for statistical analysis and decision-making. RStudio is an open source integrated development environment (IDE) for creating and running R code. It’s available in versions for Windows, Mac, and Linux. Although you don’t need an IDE in order to work with R, RStudio makes life a lot easier.

Download R from the Comprehensive R Archive Network (CRAN). In your browser, type this address if you work in Windows:

Click the link to download R. This puts the win.exe file in your Windows computer, or the.pkg file in your Mac. In either case, follow the usual installation procedures. When installation is complete, Windows users see an R icon on their desktop, Mac users see it in their Application folder. Both URLs provides helpful links to FAQs. Aug 10, 2018.

Aug 25, 2020. Jul 24, 2016. Dec 31, 2015. 134 time-saving Hotkeys for RStudio. Extensive, exportable, wiki-style reference lists for Keyboard Shortcuts/Hotkeys. Sep 18, 2017.

cran.r-project.org/bin/windows/base/

Type this one if you work on the Mac:

cran.r-project.org/bin/macosx/

Click the link to download R. This puts the win.exe file in your Windows computer, or the .pkg file in your Mac. In either case, follow the usual installation procedures. When installation is complete, Windows users see an R icon on their desktop, Mac users see it in their Application folder.

Both URLs provides helpful links to FAQs. The Windows-related URL also links to “Installation and other instructions.”

Now for RStudio.

Click the link for the installer for your computer, and again follow the usual installation procedures.

Studio

After the RStudio installation is finished, click the RStudio icon to open the window shown.

If you already have an older version of RStudio and you go through this installation procedure, the install updates to the latest version (and you don’t have to uninstall the older version).

The large Console pane on the left runs R code. One way to run R code is to type it directly into the Console pane.

The other two panes provide helpful information as you work with R. The Environment and History pane is in the upper right. The Environment tab keeps track of the things you create (which R calls objects) as you work with R. The History tab tracks R code that you enter.

Get used to the word object. Everything in R is an object.

The Files, Plots, Packages, and Help tabs are in the pane in the lower right. The Files tab shows files you create. The Plots tab holds graphs you create from your data. The Packages tab shows add-ons (called packages) you downloaded as part of the R installation. Bear in mind that “downloaded” doesn’t mean “ready to use.” To use a package’s capabilities, one more step is necessary, and you’ll want to use packages.

This figure shows the Packages tab. The packages are in either the user library (which you can see in the figure) or the system library (which you have to scroll down to).

The Help tab, shown here, provides links to a wealth of information about R and RStudio.

To tap into the full power of RStudio as an IDE, click the larger of the two icons in the upper right corner of the Console pane. That changes the appearance of RStudio so that it looks like this:

The top of the Console pane relocates to the lower left. The new pane in the upper left is the Scripts pane. You type and edit code in the Scripts pane and press Ctrl+R (Command+Enter on the Mac), and then the code executes in the Console pane.

Ctrl+Enter works just like Ctrl+R. You can also select Code → Run Selected Line(s).

1. Console
Ctrl+2Move cursor to console
Ctrl+LClean console
Command+LeftMove cursor to beginning of line
Command+RightMove cursor to end of line
Up/DownNavigate command history
Command+UpPopup command history
EscInterrupt currently executing command
Ctrl+Shift+HChange working directory

▲ up

2. Source
Ctrl+.Goto file/function
Ctrl+1Move cursor to source editor
Command+Shift+NNew document (except on chrome/windows)
Command+Option+Shift+NNew document (Chrome only)
Command+OOpen document
Command+SSave active document
Command+WClose active document (except on Chrome)
Command+Option+WClose active document (Chrome only)
Command+Shift+WClose all open documents
Command+Shift+KPreview HTML (markdown and HTML)
Command+Shift+KCompile notebook/compile PDF (TeX and Sweave)
Command+Option+IInsert chunk (Sweave and Knitr)
Command+Shift+RInsert code section
Command+EnterRun current line/selection
Option+EnterRun current line/selection (retain cursor position)
Command+Shift+PRe-run previous region
Command+Option+RRun current document
Command+Option+BRun from document beginning to current line
Command+Option+ERun from current line to document end
Command+Option+FRun from current line to document end
Command+Option+TRun the current code section
Command+Option+PRun previous sweave/Rmd code
Command+Option+CRun the current Sweave/Rmd chunk
Command+Option+NRun the next Sweave/Rmd chunk
Command+Shift+OSource a file
Command+Shift+SSource the current document
Command+Shift+EnterSource the current document (with echo)
Command+Option+LFold selected
Command+Shift+Option+LUnfold selected
Commad+Option+OFold all
Commad+Shift+Option+OUnfold all
Commad+Shift+Option+GGo to line
Commad+Shift+Option+JJump to
Ctrl+Shift+.Switch to tab
Ctrl+F11Previous tab
Ctrl+F12Next tab
Ctrl+Shift+F11First tab
Ctrl+Shift+F12Last tab
Command+F9Navigate back
Command+F10Navigate forward
Command+Option+XExtract function from selection
Command+Option+VExtract variable from selection
Command+IReindent lines
Command+Shift+CComment/uncomment current line/selection
Command+Shift+/Reflow comment
Command+Shift+AReformat selection
Command+Shift+Shift+PShow diagnostics
Option+Up/DownMove lines Up/Down
Command+Option+Up/DownCopy lines Up/Down
Ctrl+PJump to matching Brace/Paren
Ctrl+Shift+EExpand to matching Brace/Paren
Command+Shift+Option+ESelect to matching Brace/Paren
Ctrl+Option+UpAdd cursor above current cursor
Command+Option+DownAdd cursor beow current cursor
Ctrl+Option+Shift+UpMove active cursor up
Ctrl+Option+Shift+DownMove Active Cursor Down
Command+FFind and replace
Commad+GFind next
Commad+Shift+F3Find previous
Command+EUse selection for find
Command+Shift+JReplace and find
Command+Shift+FFind in files
F7Check spelling

▲ up

3. Completions (Console and Source)
Tab/Command+SpaceAttempt completion
Up/DownNavigate candidates
Enter/Tab/RightAccept selected candidate
EscDismiss completion popup

▲ up

4. Views
Command+1Move focus to Source Editor
Command+2Move focus to Console
Command+3Move focus to Help
Command+4Show History
Command+5Show files
Command+6Show plots
Command+7Show packages
Command+8Show environment
Command+9Show git/svn
Command+0Show build
Command+F8Sync editor & pdf preview
Option+Shift+KReference

▲ up

5. Build
Command+Shift+BBuild and reload
Command+Shift+LLoad all (devtools)
Command+Shift+TTest package (desktop)
Command+Option+F7Test package (web)
Command+Shift+ECheck package
Command+Shift+DDocument package

▲ up

6. Debug
Shift+F9Toggle breakpoint
F10Execute next line
Shift+F4Step into function
Shift+F6Finish function/loop
Shift+F5Continue
Shift+F8Stop debugging

▲ up

7. Plots
Command+Option+F11Previous plot
Command+Option+F12Next plot
Folder

▲ up

8. Git / SVN
Ctrl+Option+DDiff active source document
Ctrl+Option+MCommit changes
Ctrl+Up/DownScroll diff view
SpacebarStage/unstage(Git)
EnterStage/unstage and move to next (Git)

▲ up

9. Session
Command+QQuit Session (desktop only)
Command+Shift+F10Restart R Session

▲ up

10. Editing (Console and Source)
Command+ZUndo
Command+Shift+ZRedo
Command+XCut
Command+CCopy
Command+VPaste
Command+ASelect all
Command+Left/RightJump to word
Command+Home/End/Command+Up/DownJump to start/end
Command+DDelete line
Shift+ArrowSelect
Option+Shift+Left/RightSelect word
Command+Shift+LeftSelect to line start
Command+Shift+RIghtSelect to line end
Shift+Page Up/Shift+Page downSelect page up/down
Command+Shift+Home/EndSelect page start/end
Option+BackspaceDelete word left
TabIndent
Shift+TabOutdent
Ctrl+UYank line up to cursor
Ctrl+KYank line after cursor
Ctrl+YInsert currently yanked text
Option+-Insert assignment operator
Command+Shift+MInsert pipe operator
F1Show help for function at cursor
F2Show source code for function at cursor
Command+Option+UFind usages for symbol at cursor (C++)

Check R Version In Rstudio

▲ up