Skip to content

Instantly share code, notes, and snippets.

# see also seWithin function in hausekeep package
# https://hauselin.github.io/hausekeep/reference/seWithin.html
summarySE2 <- function (data = NULL, measurevar, groupvars = NULL, na.rm = TRUE, conf.interval = 0.95) {
library(data.table)
data <- data.table(data)
length2 <- function(x, na.rm = FALSE) {
if (na.rm)
sum(!is.na(x))
else length(x)
@hauselin
hauselin / github.bash
Created October 17, 2020 13:22 — forked from igrigorik/github.bash
Open GitHub URL for current directory/repo...
alias gh="open \`git remote -v | grep git@github.com | grep fetch | head -1 | cut -f2 | cut -d' ' -f1 | sed -e's/:/\//' -e 's/git@/http:\/\//'\`"
library(dplyr)
library(broom)
library(modelsummary)
clean_colnames <- function(df) {
new <- tolower(gsub(" ", "_", names(df)))
new <- gsub(".", "_", new, fixed = TRUE)
new <- gsub("(", "", new, fixed = TRUE)
new <- gsub(")", "", new, fixed = TRUE)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.