From 584e09139df310a12b9f45768f20d6823f593426 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Mon, 16 Dec 2019 22:19:19 +0100 Subject: [PATCH] get rid of MCMCpack --- DESCRIPTION | 1 - NAMESPACE | 2 +- NEWS.md | 4 +++- R/helpers_bf_tests.R | 14 +++++++++++--- README.md | 2 +- codemeta.json | 15 +-------------- docs/articles/stats_details.html | 2 +- docs/articles/tests_and_coverage.html | 2 +- docs/index.html | 2 +- docs/news/index.html | 7 +++++-- docs/reference/Titanic_full.html | 4 ++-- docs/reference/VR_dilemma.html | 4 ++-- docs/reference/bugs_long.html | 4 ++-- docs/reference/intent_morality.html | 4 ++-- docs/reference/iris_long.html | 4 ++-- docs/reference/movies_long.html | 4 ++-- docs/reference/movies_wide.html | 4 ++-- 17 files changed, 39 insertions(+), 40 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index d6a7ddd4..8f49f25c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -34,7 +34,6 @@ Imports: dplyr (>= 0.8.3), ez (>= 4.4-0), groupedstats (>= 0.1.0), - MCMCpack (>= 1.4-5), psych (>= 1.8.12), rcompanion (>= 2.3.7), rlang (>= 0.4.2), diff --git a/NAMESPACE b/NAMESPACE index 484ac076..aeee39c5 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -41,7 +41,6 @@ importFrom(BayesFactor,correlationBF) importFrom(BayesFactor,extractBF) importFrom(BayesFactor,logMeanExpLogs) importFrom(BayesFactor,ttestBF) -importFrom(MCMCpack,rdirichlet) importFrom(WRS2,onesampb) importFrom(WRS2,pbcor) importFrom(WRS2,rmanova) @@ -120,6 +119,7 @@ importFrom(stats,na.omit) importFrom(stats,oneway.test) importFrom(stats,pt) importFrom(stats,qt) +importFrom(stats,rgamma) importFrom(stats,t.test) importFrom(stats,uniroot) importFrom(stats,wilcox.test) diff --git a/NEWS.md b/NEWS.md index dfff1e28..b25f7cd0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,8 +1,10 @@ # statsExpressions 0.1.2.9000 + - Removes `MCMCpack` from `Depends`. + # statsExpressions 0.1.2 - - Maintenance release to fix additional check issues on CRAN. + - Maintenance release to fix additional check issues on `CRAN`. # statsExpressions 0.1.1 diff --git a/R/helpers_bf_tests.R b/R/helpers_bf_tests.R index cdd9a927..ac2042c1 100644 --- a/R/helpers_bf_tests.R +++ b/R/helpers_bf_tests.R @@ -253,8 +253,7 @@ bf_corr_test <- function(data, #' (1974) `"a"` parameter. #' #' @importFrom BayesFactor contingencyTableBF logMeanExpLogs -#' @importFrom stats dmultinom -#' @importFrom MCMCpack rdirichlet +#' @importFrom stats dmultinom rgamma #' @importFrom dplyr pull select rename mutate #' @importFrom tidyr uncount drop_na #' @@ -415,7 +414,16 @@ bf_contingency_tab <- function(data, # estimate log prob of data under null with Monte Carlo M <- 100000 - p1s <- MCMCpack::rdirichlet(n = M, alpha = prior.concentration * ratio) + + # rdirichlet function + rdirichlet_int <- function(n, alpha) { + l <- length(alpha) + x <- matrix(stats::rgamma(l * n, alpha), ncol = l, byrow = TRUE) + sm <- x %*% rep(1, l) + return(x / as.vector(sm)) + } + p1s <- rdirichlet_int(n = M, alpha = prior.concentration * ratio) + tmp_pr_h1 <- sapply( X = 1:M, diff --git a/README.md b/README.md index 731f3b5a..7b83c3d3 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ | [![CRAN Checks](https://cranchecks.info/badges/summary/statsExpressions)](https://cran.r-project.org/web/checks/check_results_statsExpressions.html) | [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/IndrajeetPatil/statsExpressions?branch=master&svg=true)](https://ci.appveyor.com/project/IndrajeetPatil/statsExpressions) | [![Weekly downloads badge](https://cranlogs.r-pkg.org/badges/last-week/statsExpressions?color=blue)](https://CRAN.R-project.org/package=statsExpressions) | [![Forks](https://img.shields.io/badge/forks-1-blue.svg)](https://github.com/IndrajeetPatil/statsExpressions/) | [![Rdoc](https://www.rdocumentation.org/badges/version/statsExpressions)](https://www.rdocumentation.org/packages/statsExpressions) | | [![minimal R version](https://img.shields.io/badge/R%3E%3D-3.5.0-6666ff.svg)](https://cran.r-project.org/) | [![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/) | [![Monthly downloads badge](https://cranlogs.r-pkg.org/badges/last-month/statsExpressions?color=blue)](https://CRAN.R-project.org/package=statsExpressions) | [![Github Issues](https://img.shields.io/badge/issues-7-red.svg)](https://github.com/IndrajeetPatil/statsExpressions/issues) | [![vignettes](https://img.shields.io/badge/vignettes-0.1.2-orange.svg?colorB=FF5722)](https://CRAN.R-project.org/package=statsExpressions/vignettes/) | | [![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/IndrajeetPatil/statsExpressions.svg)](https://github.com/IndrajeetPatil/statsExpressions) | [![Coverage Status](https://coveralls.io/repos/github/IndrajeetPatil/statsExpressions/badge.svg?branch=master)](https://coveralls.io/github/IndrajeetPatil/statsExpressions?branch=master) | [![Total downloads badge](https://cranlogs.r-pkg.org/badges/grand-total/statsExpressions?color=blue)](https://CRAN.R-project.org/package=statsExpressions) | [![Github Stars](https://img.shields.io/github/stars/IndrajeetPatil/statsExpressions.svg?style=social&label=Github)](https://github.com/IndrajeetPatil/statsExpressions) | [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2074621.svg)](https://doi.org/10.5281/zenodo.3386122) | -| [![Licence](https://img.shields.io/badge/licence-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) | [![Codecov test coverage](https://codecov.io/gh/IndrajeetPatil/statsExpressions/branch/master/graph/badge.svg)](https://codecov.io/gh/IndrajeetPatil/statsExpressions?branch=master) | [![HitCount](http://hits.dwyl.io/IndrajeetPatil/statsExpressions.svg)](http://hits.dwyl.io/IndrajeetPatil/statsExpressions) | [![Last-changedate](https://img.shields.io/badge/last%20change-2019--12--13-yellowgreen.svg)](https://github.com/IndrajeetPatil/statsExpressions/commits/master) | [![GitHub last commit](https://img.shields.io/github/last-commit/IndrajeetPatil/statsExpressions.svg)](https://github.com/IndrajeetPatil/statsExpressions/commits/master) | +| [![Licence](https://img.shields.io/badge/licence-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) | [![Codecov test coverage](https://codecov.io/gh/IndrajeetPatil/statsExpressions/branch/master/graph/badge.svg)](https://codecov.io/gh/IndrajeetPatil/statsExpressions?branch=master) | [![HitCount](http://hits.dwyl.io/IndrajeetPatil/statsExpressions.svg)](http://hits.dwyl.io/IndrajeetPatil/statsExpressions) | [![Last-changedate](https://img.shields.io/badge/last%20change-2019--12--16-yellowgreen.svg)](https://github.com/IndrajeetPatil/statsExpressions/commits/master) | [![GitHub last commit](https://img.shields.io/github/last-commit/IndrajeetPatil/statsExpressions.svg)](https://github.com/IndrajeetPatil/statsExpressions/commits/master) | | [![status](https://tinyverse.netlify.com/badge/statsExpressions)](https://CRAN.R-project.org/package=statsExpressions) | [![Covrpage Summary](https://img.shields.io/badge/covrpage-Last_Build_2019_12_12-yellowgreen.svg)](https://github.com/IndrajeetPatil/statsExpressions/blob/master/tests/README.md) | [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/statsExpressions/community) | [![Project Status](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active) | [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/IndrajeetPatil/statsExpressions/issues) | # Introduction diff --git a/codemeta.json b/codemeta.json index 550338de..0a592cac 100644 --- a/codemeta.json +++ b/codemeta.json @@ -15,7 +15,7 @@ ], "issueTracker": "\n https://github.com/IndrajeetPatil/statsExpressions/issues", "license": "https://spdx.org/licenses/GPL-3.0", - "version": "0.1.2", + "version": "0.1.2.9000", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", @@ -219,19 +219,6 @@ }, "sameAs": "https://CRAN.R-project.org/package=groupedstats" }, - { - "@type": "SoftwareApplication", - "identifier": "MCMCpack", - "name": "MCMCpack", - "version": ">= 1.4-5", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, - "sameAs": "https://CRAN.R-project.org/package=MCMCpack" - }, { "@type": "SoftwareApplication", "identifier": "psych", diff --git a/docs/articles/stats_details.html b/docs/articles/stats_details.html index 88ae9b27..932681c3 100644 --- a/docs/articles/stats_details.html +++ b/docs/articles/stats_details.html @@ -97,7 +97,7 @@

Test and effect size details

Indrajeet Patil

-

2019-12-13

+

2019-12-16

Source: vignettes/stats_details.Rmd diff --git a/docs/articles/tests_and_coverage.html b/docs/articles/tests_and_coverage.html index 40343b70..12904d1f 100644 --- a/docs/articles/tests_and_coverage.html +++ b/docs/articles/tests_and_coverage.html @@ -96,7 +96,7 @@

-statsExpressions 0.1.2 Unreleased +statsExpressions 0.1.2 2019-12-13

diff --git a/docs/reference/Titanic_full.html b/docs/reference/Titanic_full.html index 452c768b..ed1834fa 100644 --- a/docs/reference/Titanic_full.html +++ b/docs/reference/Titanic_full.html @@ -177,8 +177,8 @@

Examp #> 3 3 3rd Male Child No #> 4 4 3rd Male Child No #> 5 5 3rd Male Child No -#> 6 6 3rd Male Child No

dplyr::glimpse(Titanic_full)
#> Rows: 2,201 -#> Columns: 5 +#> 6 6 3rd Male Child No
dplyr::glimpse(Titanic_full)
#> Observations: 2,201 +#> Variables: 5 #> $ id <dbl> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,... #> $ Class <fct> 3rd, 3rd, 3rd, 3rd, 3rd, 3rd, 3rd, 3rd, 3rd, 3rd, 3rd, 3rd... #> $ Sex <fct> Male, Male, Male, Male, Male, Male, Male, Male, Male, Male... diff --git a/docs/reference/VR_dilemma.html b/docs/reference/VR_dilemma.html index 6f3d4457..b47411de 100644 --- a/docs/reference/VR_dilemma.html +++ b/docs/reference/VR_dilemma.html @@ -184,8 +184,8 @@

Examp #> 3 7 0 text 1 #> 4 8 0 text 1 #> 5 9 0 text 0.5 -#> 6 10 0 text 0.75

dplyr::glimpse(VR_dilemma)
#> Rows: 68 -#> Columns: 4 +#> 6 10 0 text 0.75
dplyr::glimpse(VR_dilemma)
#> Observations: 68 +#> Variables: 4 #> $ id <dbl> 1, 6, 7, 8, 9, 10, 12, 14, 15, 17, 20, 22, 28, 31, 34, 35,... #> $ order <chr> "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"... #> $ modality <chr> "text", "text", "text", "text", "text", "text", "text", "t... diff --git a/docs/reference/bugs_long.html b/docs/reference/bugs_long.html index e33d20c5..4f3e61c7 100644 --- a/docs/reference/bugs_long.html +++ b/docs/reference/bugs_long.html @@ -183,8 +183,8 @@

Examp #> 3 3 Female Europe college LDLF 5 #> 4 4 Female North America college LDLF 6 #> 5 5 Female North America some LDLF 3 -#> 6 6 Female Europe some LDLF 2

dplyr::glimpse(bugs_long)
#> Rows: 372 -#> Columns: 6 +#> 6 6 Female Europe some LDLF 2
dplyr::glimpse(bugs_long)
#> Observations: 372 +#> Variables: 6 #> $ subject <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17... #> $ gender <fct> Female, Female, Female, Female, Female, Female, Female, F... #> $ region <fct> North America, North America, Europe, North America, Nort... diff --git a/docs/reference/intent_morality.html b/docs/reference/intent_morality.html index cfa172df..100931f7 100644 --- a/docs/reference/intent_morality.html +++ b/docs/reference/intent_morality.html @@ -193,8 +193,8 @@

Examp #> 3 16 male Grace Poisoning neutral neutral neutral wrongness 1 #> 4 17 male Grace Poisoning neutral neutral neutral wrongness 1 #> 5 20 male Grace Poisoning neutral neutral neutral wrongness 2 -#> 6 22 male Grace Poisoning neutral neutral neutral wrongness 1

dplyr::glimpse(intent_morality)
#> Rows: 4,016 -#> Columns: 9 +#> 6 22 male Grace Poisoning neutral neutral neutral wrongness 1
dplyr::glimpse(intent_morality)
#> Observations: 4,016 +#> Variables: 9 #> $ id <int> 2, 11, 16, 17, 20, 22, 24, 30, 31, 33, 39, 40, 52, 53, 58... #> $ gender <fct> female, female, male, male, male, male, male, male, femal... #> $ item <fct> Grace, Grace, Grace, Grace, Grace, Grace, Grace, Grace, G... diff --git a/docs/reference/iris_long.html b/docs/reference/iris_long.html index 351394e0..dde638b0 100644 --- a/docs/reference/iris_long.html +++ b/docs/reference/iris_long.html @@ -183,8 +183,8 @@

Examp #> 3 3 setosa Sepal.Length Sepal Length 4.7 #> 4 4 setosa Sepal.Length Sepal Length 4.6 #> 5 5 setosa Sepal.Length Sepal Length 5 -#> 6 6 setosa Sepal.Length Sepal Length 5.4

dplyr::glimpse(iris_long)
#> Rows: 600 -#> Columns: 6 +#> 6 6 setosa Sepal.Length Sepal Length 5.4
dplyr::glimpse(iris_long)
#> Observations: 600 +#> Variables: 6 #> $ id <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17... #> $ Species <fct> setosa, setosa, setosa, setosa, setosa, setosa, setosa, s... #> $ condition <fct> Sepal.Length, Sepal.Length, Sepal.Length, Sepal.Length, S... diff --git a/docs/reference/movies_long.html b/docs/reference/movies_long.html index fa67422c..51f29bce 100644 --- a/docs/reference/movies_long.html +++ b/docs/reference/movies_long.html @@ -196,8 +196,8 @@

Examp #> 3 157608 PG-13 Action #> 4 114797 PG-13 Action #> 5 132745 R Drama -#> 6 97667 R Drama

dplyr::glimpse(movies_long)
#> Rows: 1,579 -#> Columns: 8 +#> 6 97667 R Drama
dplyr::glimpse(movies_long)
#> Observations: 1,579 +#> Variables: 8 #> $ title <chr> "Shawshank Redemption, The", "Lord of the Rings: The Return ... #> $ year <int> 1994, 2003, 2001, 2002, 1994, 1993, 1977, 1980, 1968, 2002, ... #> $ length <int> 142, 251, 208, 223, 168, 195, 125, 129, 158, 135, 93, 113, 1... diff --git a/docs/reference/movies_wide.html b/docs/reference/movies_wide.html index 2cc52bed..abf70572 100644 --- a/docs/reference/movies_wide.html +++ b/docs/reference/movies_wide.html @@ -198,8 +198,8 @@

Examp #> 3 0 1 0 0 1 #> 4 0 1 1 1 3 #> 5 0 0 0 0 1 -#> 6 0 0 1 0 1

dplyr::glimpse(movies_wide)
#> Rows: 1,579 -#> Columns: 13 +#> 6 0 0 1 0 1
dplyr::glimpse(movies_wide)
#> Observations: 1,579 +#> Variables: 13 #> $ title <chr> "'Til There Was You", "10 Things I Hate About You", "100 ... #> $ year <int> 1997, 1999, 2002, 2004, 1999, 2001, 1972, 2003, 1999, 200... #> $ length <int> 113, 97, 98, 98, 102, 120, 180, 107, 101, 99, 129, 124, 9...