Lab: Introduction to R
A.Y. 2021/2022
Learning objectives
The goal of this course is to provide students with a working knowledge of the software R for statistical data analysis and reporting. Students who complete the course will be shown how to use R for a variety of operations, including: data exploration and management, basic and advanced statistical operations (frequencies, hypothesis testing, linear regression), data visualization, and development of data products such as reports and slides.
Expected learning outcomes
By the end of the course students will be able to read and write code in the R language, and will have a solid foundation on which to expand their R skills independently for their own needs.
Lesson period: First trimester
Assessment methods: Giudizio di approvazione
Assessment result: superato/non superato
Single course
This course cannot be attended as a single course. Please check our list of single courses to find the ones available for enrolment.
Course syllabus and organization
Single session
Lesson period
First trimester
Course syllabus
Session 1: Setting up R and RStudio, The logic of object-oriented programming, Using R as a calculator
Session 2: Object types, Value types and conversion, Functions in R, Conditional programming, Loops, Basic vectorization
Session 3: R packages, Reading and writing data, Data exploration
Session 4: Data management 1 - base R
Session 5: Data management 2 - tidyverse and dplyr
Session 6: Data management 3 - data.table
Session 7: Data visualization
Session 8: Writing reports with R: R Markdown
Session 9: Regression analysis with R (1)
Session 10: Regression analysis with R (2)
Session 2: Object types, Value types and conversion, Functions in R, Conditional programming, Loops, Basic vectorization
Session 3: R packages, Reading and writing data, Data exploration
Session 4: Data management 1 - base R
Session 5: Data management 2 - tidyverse and dplyr
Session 6: Data management 3 - data.table
Session 7: Data visualization
Session 8: Writing reports with R: R Markdown
Session 9: Regression analysis with R (1)
Session 10: Regression analysis with R (2)
Prerequisites for admission
The course it is meant to run in parallel to the class on Data Analysis (part one), hence it will build on the statistical background developed there. The course does not assume any prior programming skills.
Teaching methods
The first session will be a general presentation of the software and overview of the course. The following sessions will consist of practical sessions where the lecturer will explain the logic of specific data operations and show the code to accomplish them with R, and the students will try by themselves on their computer.
Teaching Resources
The course is not based on a textbook. Materials, mostly in the form of HTML tutorials, will be provided by the instructor. However, in preparing the class the instructor will draw from the following two books, which students may consult in case they want to delve more deeply into the topics discussed:
· Fox, J., and Weisberg, S. An R Companion to Applied Regression (3rd Edition). Sage, 2019
· Grolemund, G., and Wickham, H. R for Data Science. O'Reilly, 2017 (available online and for free at https://r4ds.had.co.nz/)
· Fox, J., and Weisberg, S. An R Companion to Applied Regression (3rd Edition). Sage, 2019
· Grolemund, G., and Wickham, H. R for Data Science. O'Reilly, 2017 (available online and for free at https://r4ds.had.co.nz/)
Assessment methods and Criteria
Students will be assessed on the basis of 3 home assignments (2 smaller midterm assignments and 1 larger final assignment). In order to pass the course, students will have to complete all 3 assignments, regardless of whether they attend the class or not.
SPS/07 - GENERAL SOCIOLOGY - University credits: 3
Laboratories: 20 hours
Professor:
Vegetti Federico