-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tidyverse.R
33 lines (22 loc) · 987 Bytes
/
Tidyverse.R
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
# LOAD PACKAGES ############################################
# I recommend "pacman" for managing add-on packages. It will
# install packages, if needed, and then load the packages.
install.packages("pacman")
# Then load the package by using either of the following:
require(pacman) # Gives a confirmation message.
library(pacman) # No message.
# Or, by using "pacman::p_load" you can use the p_load
# function from pacman without actually loading pacman.
# These are packages I load every time.
pacman::p_load(pacman, dplyr, GGally, ggplot2, ggthemes,
ggvis, httr, lubridate, plotly, rio, rmarkdown, shiny,
stringr, tidyr)
library(datasets) # Load/unload base packages manually
# CLEAN UP #################################################
# Clear packages
p_unload(dplyr, tidyr, stringr) # Clear specific packages
p_unload(all) # Easier: clears all add-ons
detach("package:datasets", unload = TRUE) # For base
# Clear console
cat("\014") # ctrl+L
# Clear mind :)