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
filename <- paste("file", ".csv", sep = "") | |
if(filename %in% list.files()){ | |
# Load files | |
df <- read_csv(filename) | |
} else{ | |
# create df |
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
pacman::p_load(ggplot2, ggthemes) | |
# Grade needed to pass | |
passing.grade <- 4 | |
# BinSize (increment of grades) | |
binsize <- .25 | |
# Input grades | |
noten <- c(2.75, 2.5, 6.00, 3.25, 4.25, 1, 3.75, 6, 6, 5.00, 3.75, 5.25, 5.75, 4.25, 5.50, 4.50, 5.50, 4.25, 4.25, 5.25, 5.25, 2.50, 4.75, 4.75, 6.00, 5.25, 4.75, 5.25, 3.75, 3.50, 5.75, 2.50, 4.75, 4.50, 5.25, 5.00, 5.00, 5.50, 5.25, 5.25, 5.00, 3.50, 3.75, 5.00, 4.75, 4.75, 5.25, 5.50, 3.50, 3.75, 3.50, 5.25, 5.00, 5.25, 4.75, 4.75, 4.75, 4.00, 3.25, 5.00) |
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
######## Miminal working example | |
# Bin nicht sicher, ob Du alle packages hier brauchst. | |
pacman::p_load(tidyverse, nlme, ggplot2, ggthemes) | |
therapie <- read_csv("https://raw.githubusercontent.com/methodenlehre/data/master/therapie.csv") %>% | |
mutate(id = as.factor(id), | |
bedingung = as.factor(bedingung)) |
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(tidyverse, jmv, ggplot2) | |
library(ggthemes) | |
data <- read_csv(file = "https://raw.githubusercontent.com/methodenlehre/data/master/alkohol-aggression.csv") %>% | |
mutate(alkoholbedingung = factor(alkoholbedingung, | |
levels = c("kein_alkohol", "placebo", "anti_placebo", "alkohol"))) | |
# 2. ANOVA inkl. Post-hoc Tests und Helmert-Kontrasten mit jamovi-Syntax | |
jmv_res <- jmv::ANOVA( |
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
f <- function(x) (dchisq(x, 1) + dchisq(x, 2))/2 | |
curve(f, from = 0, to = 10) | |
pf <- function(x) integrate(f, 0, x)$value | |
# test | |
pf(5.14) |
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
# set paths and data names | |
external.path <- | |
"https://github.com/pharmaverse/intro-to-r-for-sas-programmers-workshop/blob/main/data" | |
# should we check first? | |
check <- TRUE | |
local.path <- ("data") | |
subdir <- file.path(local.path, "save_data") |
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
# Connect existing rstudio cloud environment to github using R | |
install.packages("usethis") | |
# Add authentication information: Use your GitHub user name and associated email address. | |
usethis::use_git_config(user.name = "StefanThoma", | |
user.email = "stefan.thoma@roche.com") | |
# Initiate git: | |
usethis::use_git() |