is_docx <- knitr::pandoc_to("docx")
is_latex <- knitr::pandoc_to("latex")

table_format <- ifelse(is_docx, "huxtable", 'default')

# I don't know how Texas Instruments smart this is, but p-sure default DPI is 96.
# That's not a problem for LaTeX, but it looks not-so-great for Word.
# For Word, let's up that to 600. This should allow for cross-referencing 
# in {bookdown} while allowing for conditional DPI

if (is_latex) {
  conditional_dpi <- 96
  return(conditional_dpi)
} else {
  conditional_dpi <- 600
  return(conditional_dpi)
} 

knitr::opts_chunk$set(echo = FALSE,
                      message=FALSE, warning=FALSE,
                      fig.path='doc/figs/',
                      cache.path = 'doc/_cache/',
                      fig.width = 8.5, dpi = conditional_dpi,
                      fig.process = function(x) {
                      x2 = sub('-\\d+([.][a-z]+)$', '\\1', x)
                      x2 = paste0(stringr::str_extract(x2, '.*/'), 
                                  "appendix-", 
                                  stringr::str_remove(x2, ".*/"))
                      if (file.rename(x, x2)) x2 else x
                      })


library(tidyverse)
library(peacesciencer)

options(knitr.kable.NA = '')

\tableofcontents \newpage

Workflow Citations

The following tools and libraries were integral to the creation of the manuscript and I want to at least acknowledge them here. Wickham et al.'s [-@wickhametal2019wt] {tidyverse} was the primary toolkit for most data transformation techniques outlined here, and indeed forms the implicit foundation of the package itself.[^aboutotherpackages] Regression tables were formatted in {modelsummary} [@arelbundock2021m], which itself uses and suggests {kableExtra} as a back-end for presentation [@zhu2021k]. The document itself is a dynamic document using familiar R Markdown syntax [@xieetal2020rmc], knitted to various outputs [@xie2015ddrk], using {bookdown} for additional functionality [@xie2016b].

I offer these citations first as an acknowledgment of these important contributions to our collective research productivity. Space restrictions in our journal preclude us from citing these important tools, even if they are truly ancillary to the product they help produce. No matter, I intend to put this appendix on my website to give Google Scholar the opportunity to find these citations and count them toward the h-indexes of the researchers responsible for these important tools.

[^aboutotherpackages]: The appendix will reference component packages of {tidyverse}, but follows the encouragement of @wickhametal2019wt to cite the overall suite of packages outlined in @wickhametal2019wt rather than reference the packages individually.

Vignette: Create Different Kinds of Data in {peacesciencer}


Vignette: A Discussion of Various Joins in {peacesciencer}


Vignette: How {peacesciencer} Coerces Dispute-Year Data into Dyad-Year Data


Vignette: Various Parlor Tricks in {peacesciencer}


Vignette: A Discussion of Correlates of War and Gleditsch-Ward Systems and {peacesciencer}


Vignette: {peacesciencer} Data Versions


\newpage

create_dyadyears(system = 'gw')

References

\setlength{\parskip}{6pt}



svmiller/peacesciencer documentation built on April 3, 2025, 1:15 p.m.