Welcome to my repository! This repository contains programming assignments I completed as part of the R Programming course conducted by Johns Hopkins University, along with some additional projects and code I'm working on using R.
-
Assignments
Contains all the assignments submitted during the course. Each assignment folder includes:- The R script(s) with code solutions.
- Detailed comments and explanations for key steps in the code.
- Supporting files such as data, if provided by the course.
-
Projects/
This directory includes personal projects and extra code I’ve been developing using R. These projects range from data analysis, visualizations, and statistical modeling to more complex tasks like machine learning or custom packages.
- Write a function named 'pollutantmean' that calculates the mean of a pollutant (sulfate or nitrate) across a specified list of monitors.
- Write a function that reads a directory full of files and reports the number of completely observed cases in each data file. The function should return a data frame where the first column is the name of the file and the second column is the number of complete cases.
- Write a function that takes a directory of data files and a threshold for complete cases and calculates the correlation between sulfate and nitrate for monitor locations where the number of completely observed cases (on all variables) is greater than the threshold. The function should return a vector of correlations for the monitors that meet the threshold requirement. If no monitors meet the threshold requirement, then the function should return a numeric vector of length 0.
(Description Source: R Programming, Programming Assignment 1 by John's Hopkins University)