# Set up the environment
library(knitr)
opts_chunk$set(cache.path='cache/', fig.path='img/', cache=F, tidy=T, fig.keep='high', echo=F, dpi=100, warnings=F, message=F, comment=NA, warning=F, results='as.is', fig.width = 10, fig.height = 6) #out.width=700, 
set.seed(1)

Libraries

# Load dplyr, ggplot2, readr, stringr, tibble, forcats, tidyr, purrr
library(tidyverse) # install.packages("tidyverse")
library(readxl)    # install.packages("readxl")
library(writexl)   # install.packages("writexl")
library(cowplot)   # install.packages("cowplot")
library(ggsci)     # install.packages("ggsci")
library(scales)    # install.packages("scales")
# scales::show_col(pal_lancet("lanonc")(8))
mycols = pal_lancet("lanonc")(8)
# Color palette for the heatmap, https://www.nceas.ucsb.edu/~frazier/RSpatialGuides/colorPaletteCheatsheet.pdf
col3 <- colorRampPalette(c('blue', 'white', 'red'))(20)
# col3 <- colorRampPalette(c('blue', 'gray', 'yellow'))(20)
# col3 <- colorRampPalette(c('green', 'black', 'red'))(20)
# col3 <- colorRamps::green2red(n = 20)

Settings

# Project folder path
dir_data <- getwd()
# Input files
fileNameIn1 <- file.path(dir_data, "")
# Output files
fileNameOut1 <- file.path(dir_data, "")

Load data

# Read in data
mtx <- read_csv(fileNameIn1)


mdozmorov/MDtemplate documentation built on April 19, 2024, 4:42 p.m.