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
Positron Version: 2024.11.0 (system setup) build 140 | |
Code - OSS Version: 1.93.0 | |
Commit: e0d844b031f95acbf89f234a2cce2af9b6721f6c | |
Date: 2024-10-31T14:14:22.699Z | |
Electron: 30.4.0 | |
Chromium: 124.0.6367.243 | |
Node.js: 20.15.1 | |
V8: 12.4.254.20-electron.0 | |
OS: Windows_NT x64 10.0.22631 |
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: "Compile Report" | |
#' author: "" | |
#' date: "" | |
#' --- | |
#' Comments that are to be displayed as normal text are marked with `#'` | |
#' at the beginning of the line. Comments that are to be displayed as | |
#' code are marked with `#` at the beginning of the line. |
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(easystats) | |
library(palmerpenguins) | |
library(lme4) | |
library(ggplot2) | |
# data generation ----------------------- | |
data(penguins) | |
d <- penguins |> |
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
easystats::install_latest(force= TRUE) | |
library(datawizard) # data wrangling and preparation | |
library(parameters) # model summaries | |
library(glmmTMB) # multilevel modelling | |
# sample data set | |
data(efc, package = "ggeffects") | |
efc <- efc |> | |
# numeric to factors, set labels as levels |
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
// save to windows-user directory | |
linters: with_defaults(object_name_linter = NULL, | |
object_length_linter(50), | |
commented_code_linter = NULL, | |
object_usage_linter = NULL, | |
line_length_linter(120), | |
cyclocomp_linter = cyclocomp_linter(50)) |
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
[ | |
{ | |
"description": "R Build Docs", | |
"key": "ctrl+shift+d", | |
"command": "r.document", | |
"when": "resourceLangId == 'r'" | |
}, | |
{ | |
"description": "R Pipe Operator", | |
"key": "ctrl+shift+m", |
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(insight) | |
library(datawizard) | |
library(modelbased) | |
library(ggeffects) | |
library(emmeans) | |
library(marginaleffects) | |
data(efc, package = "ggeffects") | |
efc <- data_to_factor(efc, select = "c161sex") | |
model <- lm(neg_c_7 ~ barthtot + c160age * c161sex, data = efc) |
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(easystats) | |
#> # Attaching packages: easystats 0.4.3 | |
#> ✔ insight 0.17.0.6 ✔ datawizard 0.4.0.14 | |
#> ✔ bayestestR 0.12.1 ✔ performance 0.9.0.3 | |
#> ✔ parameters 0.17.0.9 ✔ effectsize 0.6.0.7 | |
#> ✔ modelbased 0.8.0 ✔ correlation 0.8.0.1 | |
#> ✔ see 0.7.0.2 ✔ report 0.5.1.1 | |
library(emmeans) | |
library(marginaleffects) |
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(ggeffects) | |
library(parameters) | |
library(brms) | |
income_options <- c("below_20", "20_to_40", "40_to_100", "greater_100") | |
income <- factor(sample(income_options, 100, TRUE), | |
levels = income_options, ordered = TRUE) | |
mean_ls <- c(30, 60, 70, 75) | |
ls <- mean_ls[income] + rnorm(100, sd = 7) | |
dat <- data.frame(income, ls) |
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(glmmTMB) | |
library(ggeffects) | |
data("Salamanders") | |
m1 <- glmmTMB( | |
count ~ mined + (1 | site), | |
zi = ~ mined, | |
family = poisson, | |
data = Salamanders | |
) |
NewerOlder