Skip to content

Instantly share code, notes, and snippets.

View graebnerc's full-sized avatar

Claudius Graebner-Radkowitsch graebnerc

View GitHub Profile
@graebnerc
graebnerc / # Skript zu Tag 3 - Wiederholungsfragen Data Prep
Created July 15, 2024 12:27
Einführung in R (Frühjahrssemester 2024): Tag 3 - Recap
The notes made on the questions that you posed during day 3 on the content from day 2.
@graebnerc
graebnerc / # Skript zu Tag 3 - Visualisierung
Last active July 15, 2024 11:40
Einführung in R (Frühjahrssemester 2024): Tag 3 - Visualisierung
Hier findet sich das Skript zur Entwicklung der beiden Beispielabbildung, die wir im Kurs am 15. Juli 2024 entwickelt haben, sowie den weiteren Visualisiserungsnotizen.
@graebnerc
graebnerc / # Skript zu Tag 2
Created July 8, 2024 19:25
Einführung in R (Frühjahrssemester 2024): Tag 2
Hier sind alle Notizen und Aufgabenlösungen zu Tag 2 (8. Juli 2024).
@graebnerc
graebnerc / # Skript zu Tag 1
Created July 1, 2024 14:30
Einführung in R (Frühjahrssemester 2024): Tag 1
Hier sind alle Notizen und Aufgabenlösungen zu Tag 1 (1. Juli 2024).
@graebnerc
graebnerc / LinearRegression.R
Created June 21, 2024 13:02
Notes from the lecture on simple linear regression
library(tibble)
library(ggplot2)
library(moderndive)
# 1. Implement linear regression-----------------
# Make a shortcut to the data:
beer_data <- as_tibble(DataScienceExercises::beer)
head(beer_data)
# Conduct the linear regression:
@graebnerc
graebnerc / # Sampling
Last active June 7, 2024 14:59
Code used during the lecture on sampling.
Code used during the lecture on sampling.
@graebnerc
graebnerc / # Data Preparation: solutions
Last active May 6, 2024 19:33
Solutions for the exercises in the session on data preparation.
Solutions for the exercises in the session on data preparation.
@graebnerc
graebnerc / VisualizationScript.R
Last active April 26, 2024 15:10
The script we developed during the session on visualization. See also the lecture script on the course homepage for more explanations.
library(DataScienceExercises)
library(ggplot2)
library(scales)
# Bubble plot------
gdp_data <- DataScienceExercises::gdplifexp2007
# In the following, lines with changes are marked with '# <---'
# 1st step: empty list
gdp_plot <- ggplot()
@graebnerc
graebnerc / FunctionDefinition.R
Created April 19, 2024 12:03
The example of a function definition discussed in the recap session on April 19.
# A step-by-step solution for the first function task of the "Basics" tutorial
# Goal: define a function that computes the sample variance of a vector
# Note: there are many strategies to develop functions; here we start by first
# writing the code that solves our problem for one particular case outside the
# function, and then generalize this code in a function.
# First step: think about the starting point for your function. In our case:
# we start with a vector containing some numbers, because this is from what
@graebnerc
graebnerc / Recap1-Exercises-Template.R
Created April 18, 2024 09:52
Template file for working on the exercises for the first recap session.
# remotes::install_github("graebnerc/DataScienceExercises")
library(DataScienceExercises)
library(tibble)
# # Exercise 1: Basic object types I---------
#
# 1. Create a vector containing the numbers `2`, `5`, `2.4` and `11`.
#
# 2. Replace the second element with `5.9`.
#