knitr::opts_chunk$set(echo = TRUE)
library("knitr")
library(kableExtra)
opts_chunk$set(tidy=FALSE,tidy.opts=list(width.cutoff=30),dev="png",
               fig.width=7,fig.height=7,
               message=FALSE, warning = FALSE)

Installation

You can install the R package Robocov from Github.

install.packages("CVXR")
install_github('kkdey/Robocov')

Next load the package into R.

library(Robocov)
library(corrplot)

Demo Data

We load an example data matrix X.

data("sample_by_feature_data")
dim(sample_by_feature_data) ## dimension of data matrix
length(which(is.na(sample_by_feature_data)))/length(sample_by_feature_data) ## proportion of missing data

Standard pairwise correlation estimator

standard = cor(sample_by_feature_data, use = "pairwise.complete.obs")
corrplot::corrplot(standard, diag = TRUE,
                   col = colorRampPalette(c("lightblue4", "lightblue2", "white", "indianred1", "indianred3"))(200),
                   tl.pos = "ld", tl.cex = 0.5, tl.col = "black",
                   rect.col = "white",na.label.col = "white",
                   method = "color", type = "lower", tl.srt=45)

Robocov correlation estimator

robocov = Robocov_cor(sample_by_feature_data)
corrplot::corrplot(robocov, diag = TRUE,
                   col = colorRampPalette(c("lightblue4", "lightblue2", "white", "indianred1", "indianred3"))(200),
                   tl.pos = "ld", tl.cex = 0.5, tl.col = "black",
                   rect.col = "white",na.label.col = "white",
                   method = "color", type = "lower", tl.srt=45)

Robocov partial correlation estimator

probocov = Robocov_precision(sample_by_feature_data, alpha = 0.1)
corrplot::corrplot(probocov, diag = TRUE,
                   col = colorRampPalette(c("lightblue4", "lightblue2", "white", "indianred1", "indianred3"))(200),
                   tl.pos = "ld", tl.cex = 0.5, tl.col = "black",
                   rect.col = "white",na.label.col = "white",
                   method = "color", type = "lower", tl.srt=45)
sessionInfo()


kkdey/Robocov documentation built on June 12, 2020, 11:34 a.m.