Skip to content

Instantly share code, notes, and snippets.

View lnalborczyk's full-sized avatar

Ladislas Nalborczyk lnalborczyk

View GitHub Profile
@lnalborczyk
lnalborczyk / venn_diagrams
Last active January 9, 2025 14:45
Generating Venn diagrams from % of variance via ggVennDiagram
library(ggVennDiagram)
library(RColorBrewer)
library(tidyverse)
library(glue)
venn_3d <- function (
total_variance = 100, # total number of items
unique_x1 = 0.3, # 30% unique to X1
unique_x2 = 0.3, # 30% unique to X2
unique_y = 0.3, # 30% unique to Y
@lnalborczyk
lnalborczyk / consecutive_duplicated_words.R
Last active January 2, 2023 13:02
Find duplicated consecutive words in a character string or in a RMarkdown document
###########################################################
# Find duplicated consecutive words in a character string #
# or in a RMarkdown document #
# ------------------------------------------------------- #
# Written by Ladislas Nalborczyk #
# Contact: ladislas.nalborczyk@gmail.com #
# Last updated on January 2, 2023 #
###########################################################
# loading some packages
###########################################################
# Emphasising some references in a RMarkdown document #
# ------------------------------------------------------- #
# Written by Ladislas Nalborczyk #
# Contact: ladislas.nalborczyk@gmail.com #
# Last updated on January 2, 2023 #
###########################################################
# knitting the original Rmd file (with "keep_tex: true" in YAML)
rmarkdown::render(input = "some_file.Rmd")
@lnalborczyk
lnalborczyk / regression_optimisation.R
Last active January 2, 2023 13:05
Illustrating the Nelder & Mead (1965)'s optimisation method using gganimate
############################################################################
# estimation via the base R optim function
# code adapted from Farrell & Lewandowsky (2018, ch.3)
# https://github.com/psy-farrell/computational-modelling
#################################################################
library(hrbrthemes)
library(tidyverse)
library(gganimate)
library(magick)