Skip to content

Instantly share code, notes, and snippets.

View sinarueeger's full-sized avatar

Sina Rüeger sinarueeger

View GitHub Profile
@sinarueeger
sinarueeger / uses.md
Last active August 25, 2021 10:20
My work setup. Inspired by uses.tech and usesthis.com.
@sinarueeger
sinarueeger / 1-user-2019.md
Last active July 17, 2019 14:09
Notes + examples from useR!2019
@sinarueeger
sinarueeger / new-features.md
Last active May 11, 2019 14:24
overview of current rsnps functions
@sinarueeger
sinarueeger / phylo-pca.md
Last active July 18, 2022 23:15
Estimating phylogenetic PCs

Phylogenetic principal component analysis (in R)

The following is a guide on how to perform a phylogenetic principal component analysis.

The phylogenetic principal component analysis, short pPCA, has been proposed by Revell in 2009 and Jombart et al. 2010.

Jombart also implemented pPCA in the adephylo R-package.

@sinarueeger
sinarueeger / awk-cheatsheet
Last active December 28, 2019 04:13
awk/sed cheatsheet
## adding column N as last column to a file
FILE=~/gwas.txt
N=98
awk '$NF="98"' $FILE > tmp-file
sed -e '1s/98/N/' tmp-file > tmp2-file
## /////////////////////////////////
## satRday Paris notes
## (untidy)
## /////////////////////////////////
## Lionel Henry: Programming in the tidyverse
## tidyverse (data analysis, data manipulation, data cleaning) <----> r-lib (production prgramming)
## dplyr, ggplot2, tidyr <----> vctrs, rland, devtools
## reprocibillity by few users <----> reusability by many users
@sinarueeger
sinarueeger / howto-future.R
Created February 25, 2019 15:39
Using the future package in R for parallel computing
## //////////////////
## FUTURE PACKAGE
## //////////////////
## here is a function that sums up really slow
## ---------------------------------------------
slow_sum <- function(vec) {
SUM <- 0
@sinarueeger
sinarueeger / schur-complement-example.R
Created December 21, 2018 23:29
Schur complement example
## Schur complement
@sinarueeger
sinarueeger / add-banner.R
Last active January 24, 2022 08:19
Add banner comments to R scripts
## Add banner comments to R scripts using
## [bannerCommenter](https://cran.r-project.org/web/packages/bannerCommenter/vignettes/Banded_comment_maker.pdf).
## header -----------------------------
bannerCommenter::banner("G2G-EBV analysis using GASTON", emph = TRUE)
## section -----------------------------
bannerCommenter::banner("0. Setup", centre = TRUE, bandChar = "/")