Skip to content

Instantly share code, notes, and snippets.

View graebnerc's full-sized avatar

Claudius Graebner-Radkowitsch graebnerc

View GitHub Profile
@graebnerc
graebnerc / Session-02-Script.R
Last active September 18, 2025 08:32
Exercises for Theoretical and Empirical Research Methodology (Fall 2025) - Session 2
# 1. Basic commands-----------
# This is an addition:
2 + 4
4 - 9 # This is substraction
4/9
3*9
2**3
# This is
# a comment that spans
@graebnerc
graebnerc / Acceleration_Plots.R
Last active September 15, 2025 14:42
Was ist Wachstum - Abbildung zur großen Beschleunigung
here::i_am("Acceleration_Plots.R")
library(here)
library(readxl)
library(readr)
library(tidyr)
library(dplyr)
library(scales)
library(ggplot2)
library(ggrepel)
library(icaeDesign)
@graebnerc
graebnerc / DMC-DataSource.md
Last active August 11, 2025 21:23
Was ist Wachstum - Decoupling Abbildung

Domestic material consumption per gross domestic product - Data package

This data package contains the data that powers the chart "Domestic material consumption per gross domestic product" on the Our World in Data website. It was downloaded on April 30, 2025.

Active Filters

A filtered subset of the full data was downloaded. The following filters were applied:

CSV Structure

@graebnerc
graebnerc / filtering.R
Created June 19, 2025 07:05
Filter Missing Values Example
# dyplyr is used for such cases:
library(dplyr)
# Create a small dataset with missing values:
students <- data.frame(
name = c("Alice", "Bob", "Charlie", "Diana", "Eve"),
age = c(20, NA, 22, 19, NA),
grade = c(85, 92, NA, 78, 88),
city = c("Boston", "Chicago", NA, "Denver", "Austin")
)
@graebnerc
graebnerc / # Base code for exercises
Created May 8, 2025 18:34
Base code for exercises of the session on "AI for coding".
This is the code from which you can start working on the exercises of the session on "AI for coding".
@graebnerc
graebnerc / # Example prompts and answers
Created May 8, 2025 17:38
The prompts used as examples in the slides from the lab on "AI for Coding".
The prompts used as examples in the slides from the lab on "AI for Coding".
Results were created by Claude Sonnet 3.7 in May 2025.
@graebnerc
graebnerc / # Notes Lab 3
Created March 28, 2025 19:51
Lecture notes for lab 3
This contains a clean version of the scripts used during the lab.
@graebnerc
graebnerc / Session-04-Script.R
Last active February 25, 2025 15:57
Advanced object types - session notes and exercise solutions
# Session Script on Advanced object types
# Digression
ff <- factor(c("F", "M", "M"), levels = c("F", "M", "D"))
attributes(ff) # See the class attribute 'factor'
typeof(ff) # It still remains an integer type...
class(ff) # but the class was changed
# Factors--------------------
@graebnerc
graebnerc / #E7: Solution
Last active February 25, 2025 12:44
#E7: Possible solution for the Quarto task
The Netlify version can be found at: https://quarto-ex-solution.netlify.app/
@graebnerc
graebnerc / DesasterMarkdown.qmd
Last active February 25, 2025 12:40
The original code for the Markdown desaster and a possible solution, both written in Quarto.
---
title: "What a desaster!"
author: "Claudius"
date: '2025-05-02'
format: pdf
---
# Packages used
```{r}
library(tidyverse)