Install a package in R
But first, what’s a package and why do we need it?
A package, in R is like a toolbox for working with R
Packages provide tools such as
functions
which help you make use of all R can do
A function may
- calculate the sum of numbers
- make a plot with your data
- help you filter and sort your data
- make maps with your data
- and a lot more!
- Almost everything in R is done through functions
- Functions manipulate objects
- An object is anything that can be assigned to a variable name
An object may be:
- your
Event Data
which you bring into R and assign to the variable nameevent
so you can reference it in your code- your plot
- numbers, characters, and other types of data structures
- it may even be another function!
- R already has many inbuilt functions, so packages extend what you can do in R.