Skip to content

Instantly share code, notes, and snippets.

Avatar

Sina Rüeger sinarueeger

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

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 Dec 28, 2019
awk/sed cheatsheet
View awk-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
View satrday-paris.R
## /////////////////////////////////
## 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 Feb 25, 2019
Using the future package in R for parallel computing
View howto-future.R
## //////////////////
## FUTURE PACKAGE
## //////////////////
## here is a function that sums up really slow
## ---------------------------------------------
slow_sum <- function(vec) {
SUM <- 0
@sinarueeger
sinarueeger / add-banner.R
Last active Jan 24, 2022
Add banner comments to R scripts
View add-banner.R
## 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 = "/")