Skip to content

Latest commit

 

History

History
83 lines (61 loc) · 2.4 KB

README.md

File metadata and controls

83 lines (61 loc) · 2.4 KB

nycr_meetup_talk

That Feeling of Workflowing 20200810

Demo Stuff

Keybindings

rstudio_bindings.json

in ~/.R/rstudio/keybindings/rstudio_bindings.json:

{
    "activateTerminal": "Ctrl+3",
    "insertAssignmentOperator": "Ctrl+'",
    "insertPipeOperator": "Ctrl+Shift+'",
    "goToDefinition": "Ctrl+Shift+J"
}

addins.json

in ~/.R/rstudio/keybindings/addins.json:

{
    "fnmate::rs_fnmate": "Ctrl+Shift+F",
    "drake::rs_addin_r_make": "Ctrl+M",
    "drake::rs_addin_loadd": "Ctrl+L",
    "shrtcts::shortcut_01": "Ctrl+P",
    "shrtcts::shortcut_02": "Ctrl+Shift+O",
    "shrtcts::shortcut_03": "Ctrl+T"
}

shrcts.yaml

using {shrtcts}.

in ~/shrtcts.yml:

- Name: Source ./packages.R
  Binding: |
    cat(glue::glue('> source(\"./packages.R\")\n\n'))
    source("./packages.R")
  Interactive: true
- Name: Output symbol at cursor
  Binding: |
    target <- mmmisc::rs_get_symbol_at_cursor(rstudioapi::getActiveDocumentContext())
    cat(glue::glue("> {target}\n\n"))
    eval(as.symbol(target))
  Interactive: true
- Name: Thead at symbol at cursor
  Binding: |
    target <- mmmisc::rs_get_symbol_at_cursor(rstudioapi::getActiveDocumentContext())
    eval(parse(text = glue::glue("t(head({target}))")))
  Interactive: true

QA Stuff:

Building comfort with writing functions by forcing yourself to do it more often would be a great stepping stone to a workflow like this.

Anyone know any good resources for learning how to make R functions?