This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Normalize a numeric vector into zero-one-range | |
#' | |
#' This simple function covers simple cases: when you have a vector of numbers | |
#' larger or equal to zero, then this function normalizes these numbers into | |
#' the range between zero and one. | |
#' @param input_vector A vector of numeric values greater or equal to zero | |
#' @return A vector of the same length as `input_vector`, the elements are | |
#' normalized into the range between zero and one | |
normalize_vector <- function(input_vector){ | |
min_max_diff <- max(input_vector) - min(input_vector) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "What a desaster!" | |
author: "Claudius" | |
date: '2022-04-06' | |
output: pdf_document | |
--- | |
# Packages used | |
```{r} | |
library(tidyverse) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# T4: Intermediate exercises and possible solutions | |
# I. Create a vector with the numbers from -2 to 19 (step size: 0.75) | |
ex_1 <- seq(from=-2, to=19, by=0.75) | |
ex_1 | |
# II. Create an index vector for this first vector (note: an index vector is a | |
# vector with all possible indices of the original vector) | |
ex_1_index <- seq(1, length(ex_1)) | |
ex_1_index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Session Script T5, Advanced object types (April 6, 2022) | |
# Factors - Slide 10 | |
f_1 <- factor(c(rep("F", 2), rep("M", 3), rep("D", 3)), | |
levels = c("D", "F", "M")) | |
f_1 | |
f_2 <- factor(c(rep("F", 2), rep("M", 3), rep("D", 3))) | |
f_2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "A possible solution" | |
author: "Claudius" | |
date: "4/6/2022" | |
output: | |
html_document: | |
toc: yes | |
toc_float: yes | |
code_download: yes | |
theme: "spacelab" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
library(tidyr) | |
library(dplyr) | |
library(DataScienceExercises) # https://github.com/graebnerc/DataScienceExercises/ | |
beer_data <- DataScienceExercises::beer | |
# Original source: http://www.principlesofeconometrics.com/poe4/poe4stata.htm | |
beer_data_plot <- beer_data %>% | |
pivot_longer( | |
cols = everything(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lecture notes and solutions to the exercises of session 8 on data wrangling |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Solutions to the exercises that are mentioned in the tutorial on Monte Carlo Simulations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Code zur Replikation der Abbildung im Blogbeitrag "Zur ökonomischen Bedeutung des Genugs: Warum Suffizienz ein größere Rolle in den Wirtschaftswissenschaften spielen sollte" | |
Die Rohdaten (`Datensatz Daten_Wohnflaeche_Rebound.xlsx`) sind aus den im Blog verlinkten Quellen entnommen und können von Frauke Wiese angefordert werden. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lecture notes and solutions to the exercises of session 11 and 12 on linear models |
OlderNewer