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
AntroSO42<-read.csv("antroSO42-.csv", header = TRUE) | |
Bp <- AntroSO42[ ,(2:4), ] | |
library(tidyverse) | |
Bp %>% | |
gather(value, variable, -Class) %>% | |
ggplot(aes(Class, | |
variable)) + | |
geom_boxplot() + | |
facet_wrap( ~ value) + |
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(tidyverse) | |
# Fake data | |
full_grid <- expand_grid( | |
gen = paste0("G", 1:3), | |
loc = paste0("L", 1:3), | |
season = paste0("S", 1:4) | |
) %>% | |
mutate(env = paste(loc, season)) | |
replications(~ gen * env, full_grid) |
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
#### 1. Sign up at GitHub.com ################################################ | |
## If you do not have a GitHub account, sign up here: | |
## https://github.com/join | |
# ---------------------------------------------------------------------------- | |
#### 2. Install git ########################################################## | |
## If you do not have git installed, please do so: |
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(quantreg) | |
library(dplyr) | |
library(lubridate) | |
library(stringr) | |
library(readr) | |
library(ggplot2) | |
library(devtools) | |
library(splines) | |
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(titanic) | |
library(Amelia) | |
library(dplyr) | |
library(modeest) | |
library(ggplot2) | |
library(cowplot) | |
library(mice) | |
library(caTools) | |
library(caret) |
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) | |
ggplot(data = data.frame(x = c(-4, 6)), aes(x)) + | |
stat_function(fun = dnorm, n = 101, args = list(mean = 0, sd = 1), geom = "area", fill = "#F5BB87", alpha = 0.9) + | |
stat_function(fun = dnorm, n = 101, args = list(mean = 2.7, sd = 1), geom = "area", fill = "#BBD4EB", alpha = 0.9) + | |
coord_fixed(xlim = c(-5, 7), ratio = 8, clip = "off") + | |
annotate("segment", x = -3.9, y = 0, xend = 6, yend = 0, color = "grey60", size = 1.3) + | |
annotate("segment", x = -3.5, y = -0.04, xend = -3.5, yend = 0.42, color = "grey60", size = 1.3) + | |
annotate("text", x = 0, y = 0.18, label = "what people\nactually do\nin R", family = "Arial Bold", color = "white", size = 5.2) + | |
annotate("text", x = 2.75, y = 0.18, label = "what people\nassume others\ndo in R", family = "Arial Bold", color = "white", size = 5.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
library(tidyverse) | |
# devtools::install_github('rensa/ggflags') | |
library(ggflags) # https://github.com/rensa/ggflags | |
library(ggrepel) | |
library(ggthemes) | |
library(gganimate) | |
# Hecho por Rafa @GonzalezGouveia | |
# Con gusto para #DatosDeMiercoles, propuesto por @R4DS_es |
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
####################################################################################### | |
#example_metanalysis.R is licensed under a Creative Commons Attribution - Non commercial 3.0 Unported License. see full license at the end of this file. | |
####################################################################################### | |
#this script follows a combination of the guidelines proposed by Hadley Wickham http://goo.gl/c04kq as well as using the formatR package http://goo.gl/ri6ky | |
#if this is the first time you are conducting an analysis using this protocol, please watch http://goo.gl/DajIN while following step by step | |
#link to manuscript | |
##################################################################################### | |
#SETTING ENVIRONMENT |
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
require(plyr) | |
require(dplyr) | |
data.outliersRemoved<-ddply(data, .(withinIV1, withinIV2), function(d){ | |
limits.outliers = median(d$DV) + 2.5*c(-1, 1)*mad(d$DV)) | |
d$DV[which(((d$DV - limits.outliers[1])*(limits.outliers[2] - d$DV)) <= 0)]<-NA | |
return(d) | |
}) |