R tip-of-the-day

So many awesome ways to do R. I’ll share some, you’ll share some, it will be fun.

number tip description misc

Tip 1

cmd + opt + i

adds a new R chunk

cntrl + alt + i for PC

Tip 2

Tools -> Global Options… -> Appearance

allows for dark mode, plus other options!

Tip 3

cmd + opt + c

runs the chunk

cntrl + opt + c on PC

Tip 4

within the viewer, sorts the data wrt a variable

click on the variable name

Tip 5

cmd + shift + C

comments the line

cntrl + shift + C for PC

Tip 6

cmd + shift + enter

runs the current chunk

cntrl + shift + enter for PC

Tip 7

changes the viewer output

gear near Render

Tip 8

cmd + shift + opt + j

window to jump between chunks

cntrl + shift + opt + j for PC

Tip 9

cmd + shift + M

produces a pipe

cntrl + shift + M for PC
Tools -> Global Options… -> Code to get the native pipe

Tip 10

highlight with mouse and hit quotation

will put quotes around the highlighted phrase

Tip 11

highlight with mouse and hit parenthesis

will put parentheses around the highlighted phrase

Tip 12

cmd + opt + B

runs code start to line

cntrl + opt + B on PC
(This one did not work on my keyboard)

Tip 13

cmd + opt + E

runs code line to end

cntrl + opt + E on PC
(This one did not work on my keyboard)

Tip 14

up arrow (on keyboard)

brings back the previous line

works in Console or Terminal

Tip 15

tab complete

works in Console or in the R chunk

Tip 16

usethis::use_github()

make sure to direct to the correct folder!

Tip 17

cmd + shift + F

Find in Files

cntrl + shift + F on PC

Tip 18

cmd + click on function name

opens a tab with function details

cntrl + click on function name on PC

Tip 19

cmd + shift + D

deletes a line

cntrl + shift + D on PC

Tip 20

glimpse()

function which displays data info

Tip 21

cmd + opt + L

collapse a section

alt + L on PC

Tip 22

cmd + opt + shift + L

expand a section

alt + shift + L on PC

Tip 23

cmd + opt + O

collapse all sections

alt + O on PC

Tip 24

cmd + opt + shift + O

expand all sections

alt + shift + O on PC

Tip 25

highlight code + cmd + shift + a

reformats spacing

Tip 26

opt + cmd + arrow

duplicates line

Tip 27

highlight word + cmd + e

finds that word everywhere

Tip 28

opt + -

produces <-

Tip 29

highlight code + cmd + i

resets indenting

Reuse

CC-BY-SA-4.0