Skip to content

Instantly share code, notes, and snippets.

View sebastiansauer's full-sized avatar
🇺🇦
🇺🇦

Sebastian Sauer sebastiansauer

🇺🇦
🇺🇦
View GitHub Profile
@sebastiansauer
sebastiansauer / install-missing-r-pkgs.R
Created June 14, 2024 08:54
Install all missing packages of a given R project/folder
out <- renv::dependencies()
ps <- out$Package %>% unique()
missing <- setdiff(ps, installed.packages()) # can take a long time
missing
install.packages(missing)
@sebastiansauer
sebastiansauer / vis-nom-association.R
Created April 29, 2024 09:19
Zusammenhang zweier nominaler Variablen visualisieren mit ggplot, aufbereitet mit dplyr
library(tidyverse)
data(mtcars)
mtcars %>%
select(mpg, hp) %>%
slice_head(n = 5)
data(mtcars)
library(dplyr) # nicht "tidyverse", denn "dplyr" reicht
mtcars %>%
filter(am = 0) # den kürzesten Code, der Ihren Fehler entstehen lässt!
sessionInfo() # gibt Infos zur R-Version etc. aus
library(ggplot2)
source('geom_font_awesome.R')
shapes_map = c(
setosa = 'car',
virginica = 'ban',
versicolor = 'star'
)
(
@sebastiansauer
sebastiansauer / tmdb08.Rmd
Created June 21, 2022 10:32
Simple regularized model Kaggle TMDB competition
```{r libs, include = FALSE}
library(tidyverse)
```
```{r global-knitr-options, include=FALSE}
knitr::opts_chunk$set(fig.pos = 'H',
fig.asp = 0.618,
@sebastiansauer
sebastiansauer / tmdb04.Rmd
Created June 21, 2022 10:13
Simple tidymodels for the Kaggle competition "TMDB post office revenue"
```{r libs, include = FALSE}
library(tidyverse)
```
```{r global-knitr-options, include=FALSE}
knitr::opts_chunk$set(fig.pos = 'H',
fig.asp = 0.618,
@sebastiansauer
sebastiansauer / pie-chart-train-test.mmd
Created April 4, 2022 12:31
Mermaid simple pie chart
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sebastiansauer
sebastiansauer / nops_grading.Rmd
Created February 5, 2021 09:52
Workflow of grading an R/exams nops exams. BUGGY!
---
title: "Grading BDA WS20"
author: "Sebastian Sauer"
date: "2/5/2021"
output: html_document
---
```{r global-knitr-options, include=FALSE}
knitr::opts_chunk$set(fig.pos = 'H',
fig.asp = 0.618,
@sebastiansauer
sebastiansauer / extract_solutions.R
Created November 2, 2020 14:52
Extracting solutions from metainfo file in r-exams package
extract_solutions <- function(file) {
require(tidyverse)
# input:
# file: the output file from the exam2nops call storing the exams meta info
# output:
# list of solutions for each exam variant and each question
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019) (preloaded format=pdflatex 2020.1.13) 28 JAN 2020 11:54
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**testing.tex
(./testing.tex
LaTeX2e <2019-10-01> patch level 3
(/Users/sebastiansaueruser/Library/TinyTeX/texmf-dist/tex/latex/beamer/beamer.c
ls