-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path10-Useful_Functions.Rmd
More file actions
52 lines (41 loc) · 1.27 KB
/
Copy path10-Useful_Functions.Rmd
File metadata and controls
52 lines (41 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
title: "Ref - Useful Functions"
author: "Jonny Saunders"
date: "October 5, 2017"
output:
md_document:
preserve_yaml: true
toc: true
toc_depth: 2
order: 100
---
# Useful Functions
## RStudio Keyboard Shortcuts
Command | Description
-------- | ----------
`cmd+return` | execute current line or selection
`ctrl+l` | clear console output
`ctrl+1/2/3` | move cursor to source/console/help respectively
## Workspace
Function | Function function
---------- | ----------
`getwd()` | Return your working directory
`setwd()` | Assign a working directory to use for the current session
`ls()` | List the objects in an environment
`rm(x)` | Remove an object from the workspace (in this example, `x`)
`rm(list=ls())` | Remove all objects from the workspace
`history()` | Show the last 25 commands
## Objects
Function | Function function
---------- | ----------
typeof | Get object's base type
pryr::otype | Get object's type system (base, S3, S4, RC)
names(x) | Gets the object's names, eg. for dataframes, the column names
## Functions
Function | Function function
-------- | ----------
args(fxn) | prints the arguments and defaults of function `fxn`
## Iteration
Function | Function function
--------- | ------------
`txtProgressBar` | Keep track of how things are going