Description: Scores by journal, which is included in Figure 2 in manuscript.
Coder name(s): Althea ArchMiller
Load libraries
library(ezknitr)
library(knitr)
library(devtools)
library(ggplot2)
Clear environment and set seed
remove(list=ls())
set.seed(8675)
load(file = "data/processed_data/averages_of_reviewed_studies.Rdata")
plottingdata <- as.data.frame(matrix(NA, nrow = 9, ncol = 6))
colnames(plottingdata) <- c("Score", "SD", "upper", "lower",
"Category", "journal")
JWM
plottingdata$Score[1] <-
na.exclude(mean(averages$graphsReproduced[averages$journal=="JWM"]))
plottingdata$SD[1] <-
sd(na.exclude(averages$graphsReproduced[averages$journal=="JWM"]))
plottingdata$Category[1] <- "Figures"
plottingdata$journal[1] <- "JWM"
WSB
plottingdata$Score[2] <-
mean(na.exclude(averages$graphsReproduced[averages$journal=="WSB"]))
plottingdata$SD[2] <-
sd(na.exclude(averages$graphsReproduced[averages$journal=="WSB"]))
plottingdata$Category[2] <- "Figures"
plottingdata$journal[2] <- "WSB"
Overall
plottingdata$Score[3] <- mean(na.exclude(averages$graphsReproduced))
plottingdata$SD[3] <- sd(na.exclude(averages$graphsReproduced))
plottingdata$Category[3] <- "Figures"
plottingdata$journal[3] <- "Overall"
JWM
plottingdata$Score[4] <-
mean(na.exclude(averages$numbersReproduced[averages$journal=="JWM"]))
plottingdata$SD[4] <-
sd(na.exclude(averages$numbersReproduced[averages$journal=="JWM"]))
plottingdata$Category[4] <- "Numbers"
plottingdata$journal[4] <- "JWM"
WSB
plottingdata$Score[5] <-
mean(na.exclude(averages$numbersReproduced[averages$journal=="WSB"]))
plottingdata$SD[5] <-
sd(na.exclude(averages$numbersReproduced[averages$journal=="WSB"]))
plottingdata$Category[5] <- "Numbers"
plottingdata$journal[5] <- "WSB"
Overall
plottingdata$Score[6] <- mean(na.exclude(averages$numbersReproduced))
plottingdata$SD[6] <- sd(na.exclude(averages$numbersReproduced))
plottingdata$Category[6] <- "Numbers"
plottingdata$journal[6] <- "Overall"
JWM
plottingdata$Score[7] <-
mean(na.exclude(averages$conclusionsReproduced[averages$journal=="JWM"]))
plottingdata$SD[7] <-
sd(na.exclude(averages$conclusionsReproduced[averages$journal=="JWM"]))
plottingdata$Category[7] <- "Conclusions"
plottingdata$journal[7] <- "JWM"
WSB
plottingdata$Score[8] <-
mean(na.exclude(averages$conclusionsReproduced[averages$journal=="WSB"]))
plottingdata$SD[8] <-
sd(na.exclude(averages$conclusionsReproduced[averages$journal=="WSB"]))
plottingdata$Category[8] <- "Conclusions"
plottingdata$journal[8] <- "WSB"
Overall
plottingdata$Score[9] <- mean(na.exclude(averages$conclusionsReproduced))
plottingdata$SD[9] <- sd(na.exclude(averages$conclusionsReproduced))
plottingdata$Category[9] <- "Conclusions"
plottingdata$journal[9] <- "Overall"
plottingdata$upper <- plottingdata$Score + plottingdata$SD
plottingdata$lower <- plottingdata$Score - plottingdata$SD
Compile raw data in long format
tempdata1 <- averages[,c("studyID", "graphsReproduced", "journal")]
tempdata2 <- averages[,c("studyID", "numbersReproduced", "journal")]
tempdata3 <- averages[,c("studyID", "conclusionsReproduced", "journal")]
colnames(tempdata1) <-
colnames(tempdata2) <-
colnames(tempdata3) <- c("studyID", "Score", "journal")
tempdata1$Category <- "Figures"
tempdata2$Category <- "Numbers"
tempdata3$Category <- "Conclusions"
plottingdata.long <- rbind(tempdata1, tempdata2, tempdata3)
ggplot(data = plottingdata.long, aes(x = Category, y = Score,
colour = journal, shape = journal))+
geom_pointrange(data = plottingdata,
aes(ymin = lower, ymax = upper, shape = journal),
position = position_dodge(width = 0.6))+
geom_jitter(position = position_jitterdodge(jitter.width = 0.15,
jitter.height = 0.15,
dodge.width = 0.7),
color = "black")+
#ylim(1,5)+
theme_classic()+
theme(legend.position = "top", legend.title = element_blank())+
xlab("Reproducibility criterion")+
ylab("Reproducibility score")
## Warning: Removed 1 rows containing missing values (geom_point).
devtools::session_info()
## - Session info ----------------------------------------------------------
## setting value
## version R version 3.4.3 (2017-11-30)
## os Windows >= 8 x64
## system x86_64, mingw32
## ui RStudio
## language (EN)
## collate English_United States.1252
## ctype English_United States.1252
## tz America/Chicago
## date 2019-06-03
##
## - Packages --------------------------------------------------------------
## package * version date lib source
## assertthat 0.2.0 2017-04-11 [1] CRAN (R 3.4.4)
## backports 1.1.2 2017-12-13 [1] CRAN (R 3.4.4)
## bindr 0.1.1 2018-03-13 [1] CRAN (R 3.4.4)
## bindrcpp 0.2.2 2018-03-29 [1] CRAN (R 3.4.4)
## callr 3.1.0 2018-12-10 [1] CRAN (R 3.4.4)
## cli 1.0.1 2018-09-25 [1] CRAN (R 3.4.4)
## colorspace 1.3-2 2016-12-14 [1] CRAN (R 3.4.4)
## crayon 1.3.4 2017-09-16 [1] CRAN (R 3.4.4)
## desc 1.2.0 2018-05-01 [1] CRAN (R 3.4.4)
## devtools * 2.0.1 2018-10-26 [1] CRAN (R 3.4.4)
## digest 0.6.18 2018-10-10 [1] CRAN (R 3.4.4)
## dplyr 0.7.8 2018-11-10 [1] CRAN (R 3.4.4)
## evaluate 0.12 2018-10-09 [1] CRAN (R 3.4.4)
## ezknitr * 0.6 2016-09-16 [1] CRAN (R 3.4.4)
## fs 1.2.6 2018-08-23 [1] CRAN (R 3.4.4)
## ggplot2 * 3.1.0 2018-10-25 [1] CRAN (R 3.4.4)
## glue 1.3.0 2018-07-17 [1] CRAN (R 3.4.4)
## gtable 0.2.0 2016-02-26 [1] CRAN (R 3.4.4)
## highr 0.7 2018-06-09 [1] CRAN (R 3.4.4)
## knitr * 1.21 2018-12-10 [1] CRAN (R 3.4.4)
## labeling 0.3 2014-08-23 [1] CRAN (R 3.4.1)
## lazyeval 0.2.1 2017-10-29 [1] CRAN (R 3.4.4)
## magrittr 1.5 2014-11-22 [1] CRAN (R 3.4.3)
## markdown 0.9 2018-12-07 [1] CRAN (R 3.4.4)
## memoise 1.1.0 2017-04-21 [1] CRAN (R 3.4.4)
## mime 0.6 2018-10-05 [1] CRAN (R 3.4.4)
## munsell 0.5.0 2018-06-12 [1] CRAN (R 3.4.4)
## pillar 1.3.0 2018-07-14 [1] CRAN (R 3.4.4)
## pkgbuild 1.0.2 2018-10-16 [1] CRAN (R 3.4.4)
## pkgconfig 2.0.2 2018-08-16 [1] CRAN (R 3.4.4)
## pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.4.4)
## plyr 1.8.4 2016-06-08 [1] CRAN (R 3.4.4)
## prettyunits 1.0.2 2015-07-13 [1] CRAN (R 3.4.4)
## processx 3.2.1 2018-12-05 [1] CRAN (R 3.4.4)
## ps 1.2.1 2018-11-06 [1] CRAN (R 3.4.4)
## purrr 0.2.5 2018-05-29 [1] CRAN (R 3.4.4)
## R.methodsS3 1.7.1 2016-02-16 [1] CRAN (R 3.4.1)
## R.oo 1.22.0 2018-04-22 [1] CRAN (R 3.4.4)
## R.utils 2.7.0 2018-08-27 [1] CRAN (R 3.4.4)
## R6 2.3.0 2018-10-04 [1] CRAN (R 3.4.4)
## Rcpp 1.0.0 2018-11-07 [1] CRAN (R 3.4.4)
## remotes 2.0.2 2018-10-30 [1] CRAN (R 3.4.4)
## rlang 0.3.0.1 2018-10-25 [1] CRAN (R 3.4.4)
## rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.4.4)
## scales 1.0.0 2018-08-09 [1] CRAN (R 3.4.4)
## sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.4.4)
## stringi 1.2.4 2018-07-20 [1] CRAN (R 3.4.4)
## stringr 1.3.1 2018-05-10 [1] CRAN (R 3.4.4)
## testthat 2.0.1 2018-10-13 [1] CRAN (R 3.4.4)
## tibble 1.4.2 2018-01-22 [1] CRAN (R 3.4.4)
## tidyselect 0.2.5 2018-10-11 [1] CRAN (R 3.4.4)
## usethis * 1.4.0 2018-08-14 [1] CRAN (R 3.4.4)
## withr 2.1.2 2018-03-15 [1] CRAN (R 3.4.4)
## xfun 0.4 2018-10-23 [1] CRAN (R 3.4.4)
## yaml 2.2.0 2018-07-25 [1] CRAN (R 3.4.4)
##
## [1] C:/Users/aarchmil/Documents/R/win-library/3.4
## [2] C:/Program Files/R/R-3.4.3/library
spun with: ezknitr::ezspin(file = “programs/03_scores_by_journal_figure.R”, keep_md = FALSE, out_dir = “html_reports”, fig_dir = “figures”)