
1. Purpose: The purpose of this assignment is to begin getting your data ready for analysis in R Studio.
2. Learning Objective: By the end of this lesson, learners will be able to successfully install R and RStudio, understand the importance of file organization and proper file structures in programming, and download the necessary data for the course to begin their analysis.
Getting Started with R & R Studio
1. Purpose: The purpose of this sub-module is to install R and R Studio.
2. Learning Objective: By the end of this lesson, learners will be able to successfully install R and RStudio.
Instructions: To begin this course, you will need to install R and R Studio. You must install R before you install R Studio. The downloads and instructions can be found here on these webpages (see below).
1. Download R (linked below - for Mac and for Windows
2. Download R Studio: please download the free version only for your specific operating system (linked below)
3. Open R Studio - this will open like any other application program on your computer. Please follow the procedures you typically use to open other apps on your computer (e.g., Mac, go to your application folders and double click on the R Studio icon).
4. Web Resources: There are some great introductory videos on how to install and load both R and R Studio. For example, if you are having difficulty with downloading R and R Studio, you can search YouTube for tutorials for how to install R and R studio - coming up with videos like the one from ThatRNerd on YouTube's video on R Installation Tutorial (linked below). If you exhibit errors, you might even find some great tutorials on common errors with R Installation - I find the most common errors occur on Windows not loading things properly. I highly recommend you searching blogs and other content created that will help you with the initial phases of install, should you need them. You can also reach out to me directly with questions.
File Structures
1. Purpose: In this module, I will first introduce you to concepts that lay the groundwork for working within the R and R Studio framework. Importantly, early adoption of good data organization and file structures in R programming are essential for efficiency, reproducibility, and collaboration. Here are the key benefits:
2. Learning Objectives: By the end of this submodule, the learner will understand the value and importance of providing consistency to their organizational system in R.
3. Instructions: Creating an organizational system before you start coding in R will help streamline things. Consider the following reasons for creating organization in R.
Organizing Your Files
1. Improved Efficiency – Well-structured data and files make it easier to locate, load, and manipulate datasets, reducing time spent on debugging and searching for files.
2. Reproducibility – Organizing data properly ensures that analyses can be replicated by others (or by yourself in the future) without confusion or missing files.
3. Scalability – A structured approach allows for easy expansion of projects, enabling the integration of new data, scripts, and analyses without disrupting existing workflows.
4. Error Reduction – A consistent file structure helps avoid mistakes like using outdated datasets, misnaming variables, or losing important files.
5. Better Collaboration – A clear organization system makes it easier for teams to work together, ensuring that everyone understands where files are stored and how to navigate the project.
6. Seamless Automation – When files and data are systematically arranged, automating processes like batch data processing, report generation, and version control becomes much easier.
By adopting good organizational practices, R programmers can enhance productivity, maintain clarity in their work, and produce reliable, high-quality analyses. In this video, I give you tips, tricks, and explanations that will help you on your R journey.
Beginning with Rmarkdown
1. Purpose: The purpose of this assignment is to create your very first Rmarkdown file. You will use the data file in this assignment for the remainder of assignments. The Rmarkdown file, when it is completed, will be converted into a PDF or Word document.
2. Learning Objective: By the end of this lesson, learners will be able to install and modify RMarkdown, and review the RMarkdown cheat sheet to understand the structure and use of code chunks in creating dynamic reports.
3. Instructions: Use the video linked here to help you get through each of the steps. You may even work on this assignment as you go along in the video. Please take advantage of pausing, rewinding, etc. Follow each of the steps below to begin building your Rmarkdown file. Watch the video first, it will help explain why I am having you do some things, but also feel free to follow along in the video while coding your own project.
Rmarkdown Cheatsheets
Please also refer to the Rmarkdown cheatsheet (linked below). This can also be found in RStudio, but I have attached it here.
Loading Libraries
1. Purpose: Understanding the CRAN (Comprehensive R Archive Network) is essential for accessing and managing a wide range of R packages that extend R’s functionality. Learning how to install and load libraries from CRAN enables users to enhance their analysis capabilities by incorporating specialized tools and functions into their R environment.
2. Learning Objective: By the end of this lesson, learners will understand how to find and load libraries in R, including how to integrate them into an RMarkdown file and install them from the CRAN repository into the R system.
3. Instructions: You will set your CRAN based on your location and you will install commonly used libraries, like ggplot. We won't use them for this course, but I will show you how to find, install, and require the libraries in R and R studio.
CRAN
In R, libraries are collections of pre-written functions and datasets that extend the language’s capabilities for data analysis, visualization, statistical modeling, and more. These libraries, also called packages, are stored in repositories like CRAN (Comprehensive R Archive Network) and can be installed using install.packages("package_name") and loaded into a session with library(package_name). Popular libraries include ggplot2 for data visualization, dplyr for data manipulation, and tidyverse, which provides a suite of tools for streamlined data analysis.
There are many content creators that provide amazing tutorials on how to use R, for example, if you searched installing packages in R on YouTube, you might come across a great tutorial from Andrew Jahn on YouTube: Installing Packages Tutorial (linked below). Because R is opensource, you will find a ton of free resources online to help you along your R journey, please expand your search beyond this course and make use of all the tools and knowledge that the R community provides!
Purpose: One of the biggest hurdles early learners of R face is understanding how the system loads in data files in to the system. The purpose of this module is to discuss the most common data formats and how to load them into the Rmarkdown system.
Learning Objectives: By the end of this sub-module, the learner will be able to load in a .csv file.
Reading Data Frames
1. Purpose: Now that you have created an Rmarkdown file we can now begin building your Rmarkdown file to set your file save directory, and reading in your data files.
2. Learning Objective: By the end of this lesson, the learner will will learn how to read a data frame into R using the read.csv function.
3. Instructions: Let’s work on setting up our file structure so that we can easily access our files. Once you do that, we will start preparing the Rmarkdown file with important document information for the reader, and then we will set our working directories, read in our datafile, and check that our data loaded properly.
Module Data File
This datafile contains categorical and continuous variables in a long form format.
Sample_R_Data.csv
Purpose: Another hurdle early learners face when using R is understanding common data structures. The preferred and most common data structure to load into R is the long form data structure, so this sometimes creates obstacles when you have a wide form data file.
Learning Objectives: By the end of this module, the learner will be able to differentiate and transform wide form data structures into long form data structures.
Wide to Long Data Frames
1. Purpose: So far, we have learned how to load a data file (.csv) into R. Now, you are going to expand on that skill and work with manipulating a data frame that has a wide format into a long format.
2. Learning Objective: By the end of this lesson, the learner will learn how to transform wide form data to long form data using appropriate functions in R.
Wide & Long Form Data Formats
Wide data format is a way of structuring data in which each subject or entity is represented in a single row, with multiple columns containing different variables or measurements. This format is often used when data consists of repeated measures or time-series observations, where each observation is stored in a separate column rather than in multiple rows.
This format is useful for quick comparisons across variables but can be less efficient for statistical modeling, which often requires long data format (where each observation is in a separate row).
Long form data (also known as tidy data) is a way of structuring data where each observation is represented in its own row, with a single column used to store values for a specific variable and another column indicating the category or time point of the measurement. This format is often preferred for statistical modeling and visualization in R because it is compatible with functions in libraries like tidyverse and ggplot2.
This structure makes it easier to filter, summarize, and visualize data efficiently, as many R functions are designed to work with long-format data.
Sometimes, when we are helping people clean their data, they give us a format that isn't great or as easy to use in R. For example, when using repeated measures ANOVA in SPSS, we learn to enter the data in wide format, but long format is more common for other types of analyses and easy to use R. Here, I show you how to tranform your wide-form-data into long-form-data.
Purpose: Once learners master reading in a data file, they must check that the data is loaded in properly. The purpose of this module is to show the learner how to work with variables in the Rmarkdown environment.
Learning Objectives: By the end of this module, the learner will be able to identify best practices for naming conventions, how to manipulate data types, and perform simple computations on the data for descriptive purposes.
Manipulating Variables
1. Purpose: Now that you have learned a little about manipulating data frames, we now turn our attention to manipulating variables. Often times, we need to set parameters to our variables to ensure they are being read in properly, especially when we have categorical variables that are treated like numbers, or numbers are treated like categories. We also sometimes want to do minor modifications to our data, so that we can prepare it for statistical analysis later - such as centering and standardizing. In this video, you will learn how to manipulate your variables.
2. Learning Objective: By the end of this lesson, the learner will understand how to transform continuous variables into categorical variables, reorder variables, and perform data transformations, while also gaining proficiency in generating descriptive statistics for analysis in R.
Variable Manipulation
Knowing how to manipulate variables in R is essential because it allows you to prepare, clean, and transform data into a format suitable for analysis. Data manipulation is often the first step in any data analysis project, as raw data can come in different formats, with missing values, inconsistencies, or irrelevant information. By learning how to manipulate variables, you gain the ability to reshape datasets, create new variables, recategorize data, and address data quality issues—ensuring that your analysis is accurate and meaningful. These skills are crucial for performing tasks like handling missing data, normalizing or scaling values, transforming continuous variables to categorical ones, and filtering out unnecessary information. Ultimately, understanding how to manipulate variables in R empowers you to work more effectively with data, making it easier to derive insights and make informed decisions.
Welcome to R for Data Management: From Chaos to Clarity—an introductory course designed to help you build foundational skills in R without requiring any prior programming experience. If you’ve ever felt overwhelmed by messy spreadsheets, struggled to organize your data, or hesitated to dive into coding, this course is for you. In this hands-on course, you’ll learn how to install R and RStudio, navigate the RMarkdown environment, and confidently load and inspect your data. We’ll cover common file types like .csv and walk you through best practices for setting up your workspace. From there, you’ll explore key concepts in data structure, such as wide vs. long formats, and practice reshaping your data to suit analytical needs. You’ll also develop the skills to manipulate variables, adjust data types, and compute simple summaries to prepare your dataset for analysis. Each module features engaging video walkthroughs, guided coding sessions, and practical assignments—including debugging challenges to help you spot and fix common errors early. By the end of the course, you’ll not only understand the core mechanics of data management in R, but you’ll also have the confidence to begin your journey into more advanced analytics. Let’s turn data chaos into clarity—one line of code at a time.