Skip to content

Commit

Permalink
submit to CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
qddyy committed Oct 16, 2024
1 parent 4884001 commit ff1f632
Show file tree
Hide file tree
Showing 23 changed files with 66 additions and 50 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
^_pkgdown\.yml$
^docs$
^pkgdown$
^cran-comments\.md$
9 changes: 3 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ Package: LearnNonparam
Title: R6-Based Flexible Framework for Permutation Tests
Version: 1.2.3
Authors@R:
person("Yan", "Du", , "[email protected]", role = c("aut", "cre"))
Description: Implements various nonparametric tests in chapters 1-5 of the book "An introduction to modern nonparametric statistics" by James J. Higgins.
person(given = "Yan", family = "Du", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0009-0009-1169-921X"))
Description: Implements non-parametric tests from Higgins (2004, ISBN:0534387756), including tests for one-sample, two-sample, k-sample, paired, randomized complete block design, correlation and contingency tables. Built with 'Rcpp' for efficiency and 'R6' for flexible, object-oriented design, the package provides a unified framework for performing or creating custom permutation tests.
BugReports: https://github.com/qddyy/LearnNonparam/issues
URL: https://github.com/qddyy/LearnNonparam, https://qddyy.github.io/LearnNonparam
URL: https://github.com/qddyy/LearnNonparam, https://qddyy.github.io/LearnNonparam/
License: GPL (>= 2)
Depends:
R (>= 3.5.0)
Expand All @@ -18,11 +18,8 @@ Imports:
graphics,
compiler
Suggests:
knitr,
rmarkdown,
ggplot2
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
VignetteBuilder: knitr
4 changes: 3 additions & 1 deletion R/pmt.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pmts <- function(
#' @param alternative a character string specifying the alternative of the test.
#' @param depends,plugins,includes passed to [Rcpp::cppFunction()].
#'
#' @details The test statistic in `define_pmt` can be defined using either `R` or `Rcpp` (C++14 required), with the `statistic` parameter specified as:
#' @details The test statistic in `define_pmt` can be defined using either `R` or `Rcpp`, with the `statistic` parameter specified as:
#'
#' - `R`: a function returning a closure that returns a double.
#' - `Rcpp`: a character string defining a captureless lambda (introduced in C++11) returning another lambda that may capture by value, accepts const arguments of the same type, and returns a double.
Expand All @@ -120,6 +120,7 @@ pmts <- function(
#' Defining the test statistic using `R` follows a similar approach. The purpose of this design is to pre-calculate certain constants that remain invariant during permutation.
#'
#' @examples
#' \donttest{
#' r <- define_pmt(
#' inherit = "twosample", rejection = "lr", n_permu = 1e5,
#' statistic = function(x, y) {
Expand Down Expand Up @@ -149,6 +150,7 @@ pmts <- function(
#' options(LearnNonparam.pmt_progress = FALSE)
#' system.time(r$test(x, y))
#' system.time(cpp$test(x, y))
#' }
#'
#' @export
#'
Expand Down
16 changes: 9 additions & 7 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,25 @@ options(

## Overview

This R package implements several non-parametric tests in chapters 1-5 of [@Higgins2003](#references).
This R package implements several non-parametric tests in chapters 1-5 of [@higgins2004introduction](#references).

It depends on [R6](https://CRAN.R-project.org/package=R6) for object oriented design and [Rcpp](https://CRAN.R-project.org/package=Rcpp) for integration of R and C++.

A few examples in the book can be found [here](https://qddyy.github.io/LearnNonparam/articles/examples).

## Installation

For the latest bug fixes and improvements, please install the development version of this R package using
Install the stable version:

```{r, install_cran, eval = FALSE}
install.packages("LearnNonparam")
```

```{r, install, eval = FALSE}
Install the development version for the latest bug fixes and improvements:

```{r, install_github, eval = FALSE}
# install.packages("remotes")
remotes::install_github("qddyy/LearnNonparam")
```

Feedback and contributions are welcome. Please feel free to report bugs or request new features by opening an issue.

## Usage

```{r, library, eval = FALSE}
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,28 @@ check](https://github.com/qddyy/LearnNonparam/actions/workflows/R-CMD-check.yaml
## Overview

This R package implements several non-parametric tests in chapters 1-5
of [Higgins (2003)](#references).
of [Higgins (2004)](#references).

It depends on [R6](https://CRAN.R-project.org/package=R6) for object
oriented design and [Rcpp](https://CRAN.R-project.org/package=Rcpp) for
integration of R and C++.

A few examples in the book can be found
[here](https://qddyy.github.io/LearnNonparam/articles/examples).

## Installation

For the latest bug fixes and improvements, please install the
development version of this R package using
Install the stable version:

``` r
install.packages("LearnNonparam")
```

Install the development version for the latest bug fixes and
improvements:

``` r
# install.packages("remotes")
remotes::install_github("qddyy/LearnNonparam")
```

Feedback and contributions are welcome. Please feel free to report bugs
or request new features by opening an issue.

## Usage

``` r
Expand Down Expand Up @@ -203,10 +203,10 @@ t$test(rnorm(10), runif(10))$print()

<div id="refs" class="references csl-bib-body hanging-indent">

<div id="ref-Higgins2003" class="csl-entry">
<div id="ref-higgins2004introduction" class="csl-entry">

Higgins, James J. 2003. *An Introduction to Modern Nonparametric
Statistics*. Florence, KY: Brooks/Cole.
Higgins, J. J. 2004. *An Introduction to Modern Nonparametric
Statistics*. Duxbury Advanced Series. Brooks/Cole.

</div>

Expand Down
12 changes: 12 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Resubmission
This is a resubmission. In this version I have:

* Added references in the package description.

* Refined the description to provide a more detailed overview of the package's functionality.

## R CMD check results

0 errors | 0 warnings | 1 note

* This is a new release.
2 changes: 1 addition & 1 deletion man/figures/README/define-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion man/figures/README/define.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion man/figures/README/modify-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion man/figures/README/modify.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion man/figures/README/p_value-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ff1f632

Please sign in to comment.