Introduction to R and Basic Data Analysis

ACTEX Learning - AFDP: R Session 1.1

Author

Federica Gazzelloni and Farid Flici

Published

October 3, 2024

Set-up

If you haven’t already, please install R and RStudio on your computer:

  1. Follow this link: https://posit.co/download/rstudio-desktop/
  • Install R
  • Install RStudio

Setup RStudio-Desktop


  1. Download the material for this session from the Actuarial University Dashboard using the course link below: https://www.actuarialuniversity.com/seminar/View/14826. You’ll find a Session1.zip file with all the necessary files. Make sure to unzip the file in a location you can easily access.

  2. Open RStudio and install the necessary packages with the following command:

install.packages("tidyverse")

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.

Learning Objectives

  • Understand the R environment, basic syntax, data structures
  • Learn essential R functions covering the basics of various actuarial concepts
  • Manipulate and clean data using base R and the {tidyverse} framework
  • Perform basic statistical analysis
  • Gain first level hands-on data visualization experience with {ggplot2}

With a good understanding of these concepts, you can start exploring advanced features of R based on your specific needs.

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: