README.md

Build Status

CorrR

Latest Update Date: 2019 Feb

Overview

This project is developed to help users calculate standard deviation, correlation coefficients and covariance matrix of a given data with missing values in both R and Python.

Team

| Name | Slack Handle | Github.com | Project branch | | :------: | :---: | :----------: | :---: | | KERA YUCEL | @KERA YUCEL | @K3ra-y | Kera's link| | GOPALAKRISHNAN ANDIVEL | @Krish | @Gopsathvik | Krish's link| | WEISHUN DENG | @Wilson Deng | @xiaoweideng | Wilson's link| | Mengda Yu | @Mengda(Albert) Yu | @mru4913 | Albert's link |

Installation

CorrR can be installed in a R command window:

devtools::install_github("UBC-MDS/CorrR")

Branch Coverage Test

To test branch coverage, we use covr package. You can install by install.packages("covr").

You can double click the project and include the following in the command.

library(covr)

report()

The results are shown below.

alt text

Executing test_that tests in CorrR

To test the test coverage, we use devtools package. Installation of this package can be done by install.packages("devtools").

You can open the CorrR R project and execute the following code.

library(devtools)
load_all()
test()

The results are shown below.

alt text

Functions

Standard Deviation (std_plus)

Standard deviation calculates how close the data points to the mean, in which an insight for the variation of the data points. This function would automatically handle the missing values in the input.

std_plus will omit frustration from workflows.

Example:

> x <-  c(1,2, NA, 4, NA, 6)
> std_plus(x)
[1] 2.217356

> y <-  c(1,2, Inf, 4, NA, 6)
> std_plus(y)
[1] 2.217356

### Correlation Coefficients (corr_plus)

Correlation coefficients calculates the relationship between two variables as well as the magnitude of this relationship. This function would automatically handle the missing values in the input.

Example:

> x <-  c(1, 2, NA, 4, 5)
> y <-  c(-6, -7, -8, 9, TRUE)
> corr_plus(x, y)
[1] 0.7391091

Covariance Matrix (cov_mx)

A Covariance matrix displays the variance and covariance together. This function would use the above two functions.

A covariance matrix displays the variance and covariance together. The diagonal elements represent the variances and the covariances are represented by the other elements in the matrix shown below.

Example:

> foo_matrix <- matrix(c(1, 2, NA, 4, 5, -6, -7, -8, 9, TRUE), 5)
> cov_mx(foo_matrix)
          [,1]     [,2]
[1,]  3.333333 10.00000
[2,] 10.000000 54.91667

How does CorrR package fits into the R ecosystem?

Following functions are already present in R ecosystem. However, missing values are not being handles for the following functions and CorrR package will implement calculation of standard deviation, correlation coefficients and covariance matrix.

R Standard Deviation: https://stat.ethz.ch/R-manual/R-devel/library/stats/html/sd.html

R Correlation Coefficients: https://stat.ethz.ch/R-manual/R-devel/library/stats/html/cor.html

R Covariance Matrix: https://stat.ethz.ch/R-manual/R-devel/library/stats/html/cor.html

Milestone Progress

| Milestone | Tasks | |---|---| |Milestone 1 | Proposal| |Milestone 2 | Python package (CorrPy) is complete| |Milestone 3 | R package (CorrR) is complete|



UBC-MDS/CorrR documentation built on May 30, 2019, 2:04 a.m.