R Packages, Functions, and Documentation

Link to R packages (standard library and CRAN): https://search.r-project.org/R/doc/html/packages.html

Running functions

## Examples of using functions

# Mean function
mean(0:50)

# Documentation for the base library using library()
library(help = "base")

# Get the max value in a set of numbers
max(1:20)

# List files in a directory
list.files("outputs") 

# Read comma separated table
read.csv("outputs/cars.csv")

Installing and Loading Packages

# Install the dplyr package
install.packages("dplyr")

# Load the dplyr library to access its functions
library(dplyr)

Accessing Documentation

# Access documentation for a package
library(help = 'dplyr')

# Access package vignettes
vignette('dplyr')