Skip to content

Commit

Permalink
add 'cite_easystats' convenient helper
Browse files Browse the repository at this point in the history
  • Loading branch information
DominiqueMakowski committed Jan 18, 2021
1 parent 66a0c60 commit 1b409fd
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 1 deletion.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Remotes:
RoxygenNote: 7.1.1
Language: en-US
Collate:
'cite_easystats.R'
'format_algorithm.R'
'format_citation.R'
'format_formula.R'
Expand Down
5 changes: 5 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# Generated by roxygen2: do not edit by hand

S3method(as.character,report_parameters)
S3method(as.data.frame,cite_easystats)
S3method(as.data.frame,report)
S3method(as.report_table,cite_easystats)
S3method(as.report_table,default)
S3method(as.report_table,report)
S3method(as.report_text,default)
S3method(as.report_text,report)
S3method(format,report_table)
S3method(format_model,character)
S3method(format_model,default)
S3method(print,cite_easystats)
S3method(print,report)
S3method(print,report_effectsize)
S3method(print,report_info)
Expand Down Expand Up @@ -214,6 +217,7 @@ S3method(report_text,stanreg)
S3method(report_text,survreg)
S3method(report_text,test_performance)
S3method(report_text,zeroinfl)
S3method(summary,cite_easystats)
S3method(summary,report_effectsize)
S3method(summary,report_info)
S3method(summary,report_intercept)
Expand All @@ -238,6 +242,7 @@ export(as.report_statistics)
export(as.report_table)
export(as.report_text)
export(cite_citation)
export(cite_easystats)
export(cite_packages)
export(clean_citation)
export(data_addprefix)
Expand Down
133 changes: 133 additions & 0 deletions R/cite_easystats.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
#' Cite the easystats ecosystem
#'
#' A convenient function for those who wish to cite the easystats packages.
#'
#' @examples
#' cite_easystats()
#' summary(cite_easystats())
#' as.data.frame(cite_easystats())
#' @export
cite_easystats <- function(){
intro <- "Thanks for crediting us :) You can cite the 'easystats' ecosystem as follows:"

# TODO: How to deal with your umlaut Daniel :( ?

intext <- "Data analysis was carried out using the 'easystats' collection of packagaes (Ludecke, Waggoner, & Makowski, 2019; Makowski, Ben-Shachar, & Ludecke, 2019; Makowski, Ben-Shachar, Patil, & Ludecke, 2020; Ludecke, Ben-Shachar, Patil, & Makowski, 2020; Ben-Shachar, Ludecke, & Makowski, 2020)."


# References
ref_insight <- "Ludecke, D., Waggoner, P. D., & Makowski, D. (2019). insight: A Unified Interface to Access Information from Model Objects in R. Journal of Open Source Software, 4, 1412. doi: 10.21105/joss.01412"
ref_bayestestR <- "Makowski, D., Ben-Shachar, M.S., & Ludecke, D. (2019). bayestestR: Describing Effects and their Uncertainty, Existence and Significance within the Bayesian Framework. Journal of Open Source Software, 4(40), 1541. 10.21105/joss.01541"
ref_parameters <- "Ludecke, D., Ben-Shachar, M.S., Patil, I., Makowski, D. (2020). parameters: Extracting, Computing and Exploring the Parameters of Statistical Models using R. Journal of Open Source Software, 5(53), 2445. doi: 10.21105/joss.02445"
ref_effectsize <- "Ben-Shachar, M.S., Ludecke, D., Makowski, D. (2020). effectsize: Estimation of Effect Size Indices and Standardized Parameters. Journal of Open Source Software, 5(56), 2815. doi: 10.21105/joss.02815"
ref_correlation <- "Makowski, D., Ben-Shachar, M.S., Patil, I., & Ludecke, D. (2019). Methods and Algorithms for Correlation Analysis in R. Journal of Open Source Software, 5(51), 2306. 10.21105/joss.02306"

refs <- c(ref_insight, ref_bayestestR, ref_parameters, ref_effectsize, ref_correlation)

table <- data.frame(Reference = refs)

bib <- "
@article{ludecke2019insight,
journal = {Journal of Open Source Software},
doi = {10.21105/joss.01412},
issn = {2475-9066},
number = {38},
publisher = {The Open Journal},
title = {insight: A Unified Interface to Access Information from Model Objects in R},
url = {http://dx.doi.org/10.21105/joss.01412},
volume = {4},
author = {L{\"u}decke, Daniel and Waggoner, Philip and Makowski, Dominique},
pages = {1412},
date = {2019-06-25},
year = {2019},
month = {6},
day = {25}
}
@article{makowski2019bayestestr,
title = {{bayestestR}: {Describing} {Effects} and their {Uncertainty}, {Existence} and {Significance} within the {Bayesian} {Framework}},
volume = {4},
issn = {2475-9066},
shorttitle = {{bayestestR}},
url = {https://joss.theoj.org/papers/10.21105/joss.01541},
doi = {10.21105/joss.01541},
number = {40},
urldate = {2019-08-13},
journal = {Journal of Open Source Software},
author = {Makowski, Dominique and Ben-Shachar, Mattan S. and L{\"u}decke, Daniel},
month = aug,
year = {2019},
pages = {1541}
}
@article{makowski2020correlation,
doi={10.21105/joss.02306},
title={Methods and Algorithms for Correlation Analysis in R},
author={Makowski, Dominique and Ben-Shachar, Mattan S. and Patil, Indrajeet and L{\"u}decke, Daniel},
journal={Journal of Open Source Software},
volume={5},
number={51},
pages={2306},
year={2020}
}
@article{ludecke20202parameters,
title = {parameters: Extracting, Computing and Exploring the Parameters of Statistical Models using {R}.},
volume = {5},
doi = {10.21105/joss.02445},
number = {53},
journal = {Journal of Open Source Software},
author = {Daniel L{\"u}decke and Mattan S. Ben-Shachar and Indrajeet Patil and Dominique Makowski},
year = {2020},
pages = {2445},
}
@article{benchashar2020effectsize,
title = {{e}ffectsize: Estimation of Effect Size Indices and Standardized Parameters},
author = {Mattan S. Ben-Shachar and Daniel L{\"u}decke and Dominique Makowski},
year = {2020},
journal = {Journal of Open Source Software},
volume = {5},
number = {56},
pages = {2815},
publisher = {The Open Journal},
doi = {10.21105/joss.02815},
url = {https://doi.org/10.21105/joss.02815},
}
"

out <- list(intro=intro, intext=intext, refs=refs, table=table, bib=bib)

class(out) <- c("cite_easystats", class(out))
out
}


#' @export
as.data.frame.cite_easystats <- function(x, ...) {
x$table
}

#' @export
as.report_table.cite_easystats <- as.data.frame.cite_easystats


#' @export
summary.cite_easystats <- function(object, ...){
cat(object$intext)
insight::print_colour("\n\nReferences\n----------\n\n", "blue")
cat(paste0(paste("-", object$refs), collapse = "\n"))
}


#' @export
print.cite_easystats <- function(x, ...){
insight::print_colour(x$intro, "blue")
cat("\n\n")
cat(x$intext)
insight::print_colour("\n\nReferences\n----------\n\n", "blue")
cat(paste0(paste("-", x$refs), collapse = "\n"))
insight::print_colour("\n\nBibtex entries:\n---------------\n\n", "blue")
cat(x$bib)
}
16 changes: 16 additions & 0 deletions man/cite_easystats.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion vignettes/cite_packages.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,12 @@ Finding the right citation information is sometimes complicated. In R, this proc
url = {https://joss.theoj.org/papers/10.21105/joss.01541},
}

For other languages, such as Python or Julia, it might be a little trickier, but a quick search on Google (or github) should provide you with all the necessary information (version, authors and date). **Keep in mind that it's better to have a slightly incomplete citation than no citation at all.**
For other languages, such as Python or Julia, it might be a little trickier, but a quick search on Google (or github) should provide you with all the necessary information (version, authors and date). **Keep in mind that it's better to have a slightly incomplete citation than no citation at all.**

## cite_easystats()

If you want to cite the **easystats** ecosystem, you can use the [`cite_eaststats()`](https://easystats.github.io/easystats/reference/cite_eaststats.html) function:

```{r message=FALSE, warning=FALSE, results='asis'}
cite_easystats()
```

0 comments on commit 1b409fd

Please sign in to comment.