Snippets

Snippets of R code to reuse almost as is. There is 82 resources on this index.

How to rename items in a legend · #82

How to draw a second geom_ from a different dataframe · #81

How to uninstall packrat in a RStudio project · #80

How to sort a discrete axis in a plot · #79

Change the direction of items in a legend · #78

Change the direction of multiple legends in the legend · #77

Change the justification of multiple legends in the legend · #76

Change the justification of the legend · #75

Move the legend around a plot · #74

Hide a legend in the legend · #73

Combine multiple legends in the legend · #72

Change the title of a legend · #71

Add a caption to a plot · #70

Change the axis labels in a plot · #69

Change multiple labs() elements in a plot · #68

Add a subtitle to a plot · #67

Add a title to a plot · #66

Hide the legend in a plot · #65

Convert a color from its name to HEX code · #64

List the name of all the built-in colors · #63

Get the name of built-in colors · #62

Use a Brewer color scale · #61

Display all Brewer color palettes · #60

Get the geographical coordinates of a location (geocoding) · #59

Compute the arctangent of a number · #58

Compute the arcsine of a number · #57

Compute the arccosine of a number · #56

Compute the tangent of a number · #55

Compute the sine of a number · #54

Compute the cosine of a number · #53

Compute the logarithm of a number · #52

Compute the exponential of a number · #51

Compute the absolute value of a number · #50

Compute the square root of a number · #49

Compute the power of a number · #48

Divide two or more numbers · #47

Multiply two or more numbers · #46

Subtract two or more numbers · #45

Add two or more numbers · #44

Compute a variance · #43

Compute a standard deviation · #42

Compute a sum · #41

Compute a mean · #40

Get the number of characters in a string · #39

Concatenate two (or more) character strings · #38

Load a library · #37

Create a list of objects · #36

Get the number of columns in a dataframe · #35

Get the number of rows in a dataframe · #34

Get the names of all the columns of a dataframe · #33

Access ready-to-use R code snippets

Unlock now