install.packages("tidyverse")
install.packages("lifecontingencies")
install.packages("actuar")
Introduction to R
ACTEX Learning - AFDP: R Session
Set-up
If you haven’t already, please install R and RStudio on your computer:
- Follow this link: https://posit.co/download/rstudio-desktop/
- Install R
- Install RStudio
Download the material for this session from the Actuarial University Dashboard using the course link: https://www.actuarialuniversity.com/seminar/View/15335.
Open RStudio and install the necessary packages with the following command:
Introduction to R Programming Environment
R is a programming language and statistical development environment widely used for data analysis, visualization, and statistical modeling. It is an open-source language that provides a wide range of functions and packages specific to data processing and statistics.
R is particularly popular among statisticians, data analysts, and data scientists due to its power and flexibility in data processing and analysis. It comes with numerous statistical functions, data manipulation capabilities, and visualization tools, making it a versatile tool for exploring and analyzing data.
RStudio is an integrated development environment (IDE) for R that provides a user-friendly interface for writing, executing, and managing R code. It offers features such as syntax highlighting, code completion, and project management, making it easier to work with R.
Resources
In case you get stuck or you just want to learn more about R, here are some resources to help you along the way:
help.start()
?syntax
(hint. substitute syntax with your function)
You can open a help page for any object that comes with R or with an R package. To open the help page, type a ?
before the object’s name and then run the command.
More Resources:
- The R Manuals: https://cran.r-project.org/manuals.html
- R for Data Science by Hadley Wickham and Garrett Grolemund. Available online at https://r4ds.had.co.nz/
- CRAN Task View: Actuarial Science: https://cran.r-project.org/web/views/ActuarialScience.html
- R/Insurance Series: For Everyone in Insurance or Actuarial Science: https://www.r-consortium.org/r-insurance-series-for-everyone-in-insurance-or-actuarial-science