Introduction to R and RStudio for Data Analysis in Scientific Research
Course convenors: Shaun Nielsen and Cristina Diez Vives.
Course objective
The objective of this course is to equip participants with the fundamental skills and knowledge to confidently use R and RStudio for data analysis in scientific research. They will gain practical experience in using R for data manipulation, visualisation and analysis, empowering them to extract meaningful insights from their datasets. Throughout the course, learners will explore essential concepts such as importing, transforming, and visualising data, basic statistics while being exposed to scripts, projects, R packages, using help documentation and troubleshooting errors. By the end of the course, participants will have a solid foundation in R, enabling them to continue in their own R journey efficiently and effectively.
The course will be conducted concurrently in person at Museo Nacional de Ciencias Naturales (Madrid) and online through a conference meeting.
Who this course is for?
Students and academics using R for research
Prerequisites
No previous R knowledge
Material required
- Computer with R and RStudio installed (further instructions will be give prior to the start of the course)
Material provided
- Lecture notes covering core concepts
- Coding exercises and example datasets
Course outline
The course will consist of 4 modules to be completed over 12 hours (3 hours over 4 days). The course will use the book ‘R for Data Science’ by Wickham and Grolemund (https://r4ds.hadley.nz/) and ‘Introductory Statistics with R’ by Peter Dalgaard (https://www.academia.dk/BiologiskAntropologi/Epidemiologi/PDF/Introductory_Statistics_with_R__2nd_ed.pdf) as reference material.
Structure
- Short lectures and coding demonstrations
- Coding exercises
- Discussion
Before the course begins
- Instructions will be provided to install R, RStudio and various R packages before the course begins, and to verify everything is working correctly.
Module 1: Introduction to R
- Overview of R
- It’s applications
- How it works
- R is built with packages
- Challengers for the new user
- RStudio layout and basic operations
- Entering code
- Basic RStudio options
- R scripts and RStudio projects
- Coding basics
- R is a calculator
- Assigning variables
- Naming variables and their rules
- Vector arithmetic
- Functions
- The data.frame and other data types and structures in R
- The data.frame is a tabular data structure
- Data types - numbers, strings, logical, dates
- Data vectors – the columns of a data.frame
- Interacting with data.frames
- Selecting data to work with
- Conduct a simple analysis
- Import and examine data
- Create a summary
- Plot the data
- Do a statistical test
Module 2: Data import and manipulation with the tidyverse packages
- Installing and loading R packages
- Importing data into R: reading CSV, Excel, and other common file formats
- Exporting data from R: writing data to CSV, Excel, and other formats
- Data organisation in spreadsheets
- The pipe operator
- Manipulating data: selecting or creating columns, filtering rows, arranging data
- Summarizing data: grouping and summarizing functions
- Joining multiple data sets
- Reshaping data: wide and long transformations
Module 3 Data Visualization with ggplot2 and others
- Basic plots: histograms, scatter plots, line plots, bar plots, boxplots
- Customizing plots: adding titles, labels, colours, and themes
- Faceting: creating multiple plots based on subsets of data
- Dendrograms and heatmaps
- Exporting plots
Module 4: Introduction to Statistical Analysis with R
- Descriptive statistics: mean, median, variance, standard deviation
- Introduction to t-tests, linear regression, ANOVA
- Introduction to other statistical methods
Para formalizar la inscripción enviad copia de transferencia a favor de la : Sociedad de Amigos del Museo Nacional de Ciencias Naturales
Al correo: mcnc104@mncn.csic.es
Datos bancarios:
Sociedad de Amigos del Museo Nacional de Ciencias Naturales
BBVA( Goya, 14 de Madrid) ES52 0182 0915 14 0000153019
- BIC BVAESMM
Concepto: R 2025+ Apellido
Fecha
- Lunes, 19 Mayo 2025
Horario
Días 19,21, 27 y 29 May
9:30 a 13.00 (12 hours)
Plazas
50 in-person places 20 in remote
Reservations mail
Technical information
Tarifas
150 € (SAMNCN members and students 140€)