- Related Setup: https://gist.github.com/hofmannsven/6814278
- Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
- Interactive Beginners Tutorial: http://try.github.io/
- Git Cheatsheet by GitHub: https://services.github.com/on-demand/downloads/github-git-cheat-sheet/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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(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) |
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
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:\/\//'\`" |
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
# 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) |
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
df_long = pd.DataFrame( | |
{"student": ["Andy", "Bernie", "Cindy", "Deb", "Andy", "Bernie", "Cindy", "Deb", "Andy", "Bernie", "Cindy", "Deb"], | |
"school": ["Z", "Y", "Z", "Y", "Z", "Y", "Z", "Y", "Z", "Y", "Z", "Y"], | |
"class": ["english", "english", "english", "english", "math", "math", "math", "math", "physics", "physics", "physics", "physics"], | |
"grade": [10, 100, 1000, 10000, 20, 200, 2000, 20000, 30, 300, 3000, 30000] | |
} | |
) | |
df_long | |
> student school class grade |
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
def simulate(simulations=1000, n=500, quantile=0.80): | |
correlations = np.zeros(simulations) | |
for i in range(simulations): | |
data = {"personality": np.random.randn( | |
n), "attract": np.random.randn(n)} | |
df = pd.DataFrame(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
Atom Settings |
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
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) | |
} | |
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
#function to read raw data from Qualtrics | |
cleanQualtrics <- function(csvFile, rowAsHeader, skipRows) { | |
#this function assumes that you have named your | |
#Qualtrics questions properly when setting up the survey; | |
#if questions are properly named, then the first row | |
#will be most informative and suitable for use as column names | |
#read.csv sets header = T by default; stringsAsFactor set to FALSE to ensure strings aren't converted to factors | |
QualtricsRaw <- read.csv(csvFile, header = F, stringsAsFactors = F) | |
#row 1 contains the strings that we'd like to use as column names; select row 1 and turn them into characters | |
colNames <- as.character(QualtricsRaw[rowAsHeader,]) |
NewerOlder