Slide 1

Slide 1 text

Let’s build your first RStudio snippets and Addins! @aswansyahputra Muhammad Aswan Syahputra

Slide 2

Slide 2 text

R (+)

Slide 3

Slide 3 text

Main features: ● Console ● Syntax-highlighting editor ● Tools for plotting, history, debugging and workspace management

Slide 4

Slide 4 text

Dig the gems!

Slide 5

Slide 5 text

Snippets ● Put your codes into reusable template ● Less typing ● Less error ● Less time ● Preset available, but a lot of room for customisation!

Slide 6

Slide 6 text

Snippets ● Go to Tools – Global Options – Code ● Check ‘Enable code snippets’ ● Click ‘Edit snippets’ for editing snippet name put your code here... snippet name put your code here... snippet name fun(arg1 = ${1:arg1} snippet name fun(arg1 = ${1:arg1}

Slide 7

Slide 7 text

Addins ● Gadget for RStudio ● Basically are functions ● Turn line of codes into GUI ● Do magical things!

Slide 8

Slide 8 text

Addins Try them out! ● datapasta ● reprex ● styler ● colourpicker ● regexplain ● ggThemeAssist DESCRIPTION LICENSE NAMESPACE R/ yourfunction.R inst/ rstudio/ addins.dcf DESCRIPTION LICENSE NAMESPACE R/ yourfunction.R inst/ rstudio/ addins.dcf Name: this_addin Description: do_that Binding: yourfunction Interatice: true/false Name: this_addin Description: do_that Binding: yourfunction Interatice: true/false

Slide 9

Slide 9 text

Let’s make them! s.id/snippetsaddins

Slide 10

Slide 10 text

Next? Have fun!

Slide 11

Slide 11 text

Telegram: @GNURIndonesia (t.me/GNURIndonesia) Web: www.r-indonesia.id GitHub: www.github.com/indo-r R Indonesia

Slide 12

Slide 12 text

R Indonesia

Slide 13

Slide 13 text

Thanks! [email protected] www.aswansyahputra.com speakerdeck.com/aswansyahputra