Learning *apply() Functions

This article is intended to briefly summarize what I’ve learn about the *apply functions. split() and lapply() We’ll work on the Air Quality *.csv file from the Data Science Specialization course: > airquality <- read.csv(“rcourse/hw1_data.csv”) > head(airquality) We want to create a matrix that contain the monthy means of each column : > s <- split(airquality,Continue reading “Learning *apply() Functions”

R Programming Course – Assignment 1 : Air Pollution Part 3

Part 1 : pollutantmean() Part 2 : complete() Part 3 : corr() 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. TheContinue reading “R Programming Course – Assignment 1 : Air Pollution Part 3”

R Programming Course – Assignment 1 : Air Pollution Part 2

Part 1 : pollutantmean() Part 2 : complete() 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 ofContinue reading “R Programming Course – Assignment 1 : Air Pollution Part 2”

R Programming Course – Assignment 1 : Air Pollution Part 1

I am taking the R programming course from the Data Science Specialization offered by the John Hopkins University on Coursera. This blog post is a personal notes taking where we can follow the reasoning during the exercices. Today I try to complete the Assignement 1 “Air Pollution” Part 1. We are given a .zip fileContinue reading “R Programming Course – Assignment 1 : Air Pollution Part 1”