Skip to content

Latest commit

 

History

History
385 lines (273 loc) · 22.8 KB

r.md

File metadata and controls

385 lines (273 loc) · 22.8 KB

R

Table of Contents

Base

update all R packages

install.packages("rvcheck")

library(rvcheck)
update_all(check_R=FALSE)

install github repo

install.packages(c("RCurl", "curl", "httr", "openssl"))

library(devtools)
devtools::install_github("kassambara/survminer")
# if http error: manually download and install_url("file:///home/xxx/xx.tar.gz")

Tutorial 

Packages

Text

Performance

docs

packages

  • future - R package: future: Unified Parallel and Distributed Processing in R for Everyone
  • furrr - simplify the combination of purrr’s family of mapping functions and future’s parallel processing capabilities.

Install

> devtools::install_github("houyunhuang/ggcor")
Error in curl::curl_fetch_memory(url, handle = h) 
error setting certificate verify locations:
CAfile: /opt/microsoft/ropen/3.5.2/lib64/R/lib/microsoft-r-cacert.pem 
CApath: none

One solution :

remove.packages(c("curl","httr"))
install.packages(c("curl", "httr"))

file.edit('~/.Renviron')
CURL_CA_BUNDLE=/usr/lib/R/lib/microsoft-r-cacert.pem
http_proxy="http://127.0.0.1:12333"
https_proxy="http://127.0.0.1:12333"

Or

Sys.setenv(http_proxy="http://127.0.0.1:12333")
Sys.setenv(https_proxy="http://127.0.0.1:12333")

Data wrangling

io

data structure

  • tibble - A tibble, or tbl_df, is a modern reimagining of the data.frame, keeping what time has proven to be effective, and throwing out what is not.

tools

CLI

ML

docs

packages

Visualization

book

misc

circos like

graph

Shiny

Color

Heatmap

ggplot2

Extended packages. More: RStartHere, ggally

ggplot2 extensions - gallery

  • esquisse - RStudio add-in to make plots with ggplot2

  • ggthemes - Some extra themes, geoms, and scales for ggplot2.

  • hrbrthemes - Opinionated, typographic-centric ggplot2 themes and theme components

  • ggcharts - provides a high-level ggplot2 interface for creating common charts.

  • ggsci - Scientific Journal and Sci-Fi Themed Color Palettes for ggplot2

  • cowplot  - provide a publication-ready theme for ggplot2. similar package: ggmatrix, ggpairs, ggscatmat

  • ggfortify - Define fortify and autoplot functions to allow ggplot2 to handle some popular R packages. http://cos.name/2015/11/ggfortify-visualization-in-one-line-of-code/

  • ggrepel - Repel overlapping text labels away from each other.

  • ggtext - Improved text rendering support for ggplot2. ggtext::geom_richtext.

  • ggalt - Extra Coordinate Systems, Geoms and Statistical Transformations for 'ggplot2' https://cran.rstudio.com/web/packages/ggalt/ggalt.pdf , geom_lollipop

  • ggforce - aime primarily at ad hoc data visualization in order to investigate the data at hand, and less at utilities for composing custom plots a la D3.js.

  • sina plot: geom_sina: enhanced jitter strip char

  • gganimate - Create easy animations with ggplot2

  • ggord - a take on ordination plots using ggplot2

  • gbiplot - A biplot based on ggplot2

  • ggvis- Interactive grammar of graphics for R

  • ggcorr: correlation matrixes with ggplot2

  • ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data.

  • ggsurv - survival curves with ggplot2

  • ggExtra Add marginal histograms to ggplot2, and more ggplot2 enhancements http://daattali.com/shiny/ggExtra-ggMarginal-demo/

  • ggradar - radar charts with ggplot2

  • ggRandomForests : Visually Exploring Random Forests

  • ggmcmc: Tools for Analyzing MCMC Simulations from Bayesian Inference

  • ggalluvial - alluvial diagrams in ggplot2

  • ggpubr - 'ggplot2' Based Publication Ready Plots

  • gggenes - Draw gene arrow maps in ggplot2

  • ggfittext - ggplot2 geoms to fit text into boxes

  • ggbeeswarm - Provides methods for beeswarm plots in ggplot2

  • gghighlight - Highlight points and lines in ggplot2

  • waffle - Make waffle (square pie) charts in R introduction

  • ggridges - Geoms to make ridgeline plots with ggplot2

  • ggwrap - ‘ggwrap’ wraps a ‘ggplot2’ plot over multiple rows, to make plots with long x axes easier to read.

  • ggbump - A geom for ggplot to create bump plots

  • ggdag - An R Package for visualizing and analyzing causal directed acyclic graphs

  • ggpol

  • gghalves - Easy half-half geoms in ggplot2 https://erocoar.github.io/gghalves/

  • sugrrants - Calendar-based graphics

  • lindia - Extension package of linear regression diagonostic plots in ggplot2.

  • ggnewscale - Multiple Fill and Color Scales in ggplot2

  • ggrastr - Provides a set of ggplot2 geoms to rasterize only specific layers of the plot

  • ggvenn

  • gggenomes - A grammar of graphics for comparative genomics

  • ggside - ggplot2 extension allowing for plotting various geometries as side panels using the ggplot2 API

  • ggTimeSeries - Time series visualisation. 用R语言画日历. calendarheatmap

  • ggh4x - ggplot extension: options for tailored facets, multiple colourscales and miscellaneous

  • geomtextpath - Create curved text paths in ggplot2

Tutorial

Statistics

book

misc

Cluster

File formats

  • rio - A Swiss-army knife for data I/O

reads xlsx/xls library(xslx)

data <- read.xlsx("datafile.xlsx", 1)
library(gdata)
# Read first sheet
data <- read.xls("datafile.xls")

Misc

Bioinformatics

batch effect

  • sva - Surrogate Variable Analysis, contains functions for removing batch effects and other unwanted variation in high-throughput experiment.

ID mapping

xxx

GLM

Enrichment Analysis

Dataset

Survival Analysis

Cox Proportional-Hazards Model

TCGA

Ecology