Skip to content

Commit

Permalink
small fixes before CRAN submission
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardklap committed Aug 23, 2024
1 parent d7e7e74 commit 8546764
Show file tree
Hide file tree
Showing 15 changed files with 129 additions and 27 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
^doc$
^Meta$
^CITATION\.cff$
^cran-comments\.md$
19 changes: 12 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
Package: neuroUp
Type: Package
Title: Plan Sample Size for fMRI Regions of Interest research using Bayesian updating
Title: Plan Sample Size for Task fMRI Research using Bayesian Updating
Version: 0.2.0
Authors@R: c(person( "Eduard", "Klapwijk",
email = "[email protected]",
role = c("aut", "cre"),
role = c("aut", "cre", "cph"),
comment = c(ORCID = "0000-0002-8936-0365")),
person( "Herbert", "Hoijtink",
role = c("aut"),
role = c("aut", "cph"),
comment = c(ORCID = "0000-0001-8509-1973")),
person( "Joran", "Jongerling",
role = c("aut"),
role = c("aut", "cph"),
comment = c(ORCID = "0000-0001-5697-1381")))
Description: The package calculates the precision in mean differences (raw or Cohen's D) and correation coefficients for different sample sizes using permutations of the collected data.
Description: Calculate the precision in mean differences (raw or Cohen's D) and
correlation coefficients for different sample sizes. Uses permutations of the
collected functional magnetic resonance imaging (fMRI) region of interest data.
Method described in Klapwijk, Jongerling, Hoijtink and Crone (2024)
<doi:10.31234/osf.io/cz32t>.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
NeedsCompilation: no
Imports:
dplyr,
Expand All @@ -37,4 +41,5 @@ Depends:
R (>= 2.10)
Roxygen: list(markdown = TRUE)
VignetteBuilder: knitr
URL: https://eduardklap.github.io/neuroUp/
URL: https://eduardklap.github.io/neuroUp/, https://github.com/eduardklap/neuroUp
BugReports: https://github.com/eduardklap/neuroUp/issues
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YEAR: 2022
YEAR: 2024
COPYRIGHT HOLDER: neuroUp authors
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License

Copyright (c) 2022 neuroUp authors
Copyright (c) 2024 neuroUp authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 4 additions & 4 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#' \item{lnacc_self_winvsloss}{parameter estimates for the left nucleas accumbens for
#' the contrast winning versus losing (-2.60-4.47)}
#' }
#' @source {Schreuders, E., Braams, B. R., Blankenstein, N. E., Peper, J. S., Güroğlu, B., &
#' @source {Schreuders, E., Braams, B. R., Blankenstein, N. E., Peper, J. S., Guroglu, B., &
#' Crone, E. A. (2018). Contributions of reward sensitivity to ventral striatum activity across
#' adolescence and early adulthood. Child development, 89(3), 797-810.}
#' \doi{10.1111/cdev.13056}
Expand All @@ -48,7 +48,7 @@
#' Self-evaluations task fMRI region of interest data
#'
#' A dataset containing the parameter estimates of the
#' left medial prefrontal cortex (x = 6, y = 50, z = 4),
#' left medial prefrontal cortex (x = -6, y = 50, z = 4),
#' with one value for the mean activation during self-evaluation
#' and one value for the mean activation during the control condition for all participants.
#'
Expand All @@ -71,7 +71,7 @@
#'
#' A dataset containing the parameter estimates from
#' the anatomical mask of the left nucleus accumbens (Harvard-Oxford subcortical atlas;
#' thresholded at 40%; center-of-mass coordinates x = 10, y = 12, z = 7; 28 voxels included),
#' thresholded at 40%; center-of-mass coordinates x = -10, y = 12, z = -7; 28 voxels included),
#' with one value for the mean activation during gaining for self and one value for the mean
#' activation during no-gain for self and charity for all participants.
#'
Expand All @@ -86,6 +86,6 @@
#' }
#' @source {Spaans, J., Peters, S., Becht, A., van der Cruijsen, R., van de Groep, S.,
#' & Crone, E. A. (2023). Longitudinal neural and behavioral trajectories of charity
#' contributions across adolescence. Journal of Research on Adolescence, 33(2), 480495.}
#' contributions across adolescence. Journal of Research on Adolescence, 33(2), 480-495.}
#' \doi{10.1111/jora.12820}
"vicar_char"
4 changes: 2 additions & 2 deletions R/estim_corr.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' @param name The title of the dataset or variables to be displayed with the
#' figure. Defaults to `""`
#' @returns
#' * `tbl_select` returns a [tibble::tibble()] containing estimates of the Pearson’s
#' * `tbl_select` returns a [tibble::tibble()] containing estimates of the Pearson
#' correlation between two correlated variables with associated SD, SE, 95% CI,
#' and width of the 95% CI (lower, upper) for five different sample sizes
#' (starting with the minimum sample size, then 1/5th parts of the total
Expand All @@ -23,7 +23,7 @@
#' for each sample size are plotted in orange
#' * `fig_corr_nozero` returns a barplot where for each of the five sample sizes
#' the proportion of permutations not containing zero is displayed
#' * `tbl_total` returns a [tibble::tibble()] containing estimates of the Pearson’s
#' * `tbl_total` returns a [tibble::tibble()] containing estimates of the Pearson
#' correlation between two correlated variables with associated SD, SE, 95% CI,
#' and width of the 95% CI (lower, upper) for all sample sizes, including the
#' permutation number.
Expand Down
2 changes: 1 addition & 1 deletion R/sample_corr.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @param data Dataframe with the data to be analyzed
#' @param vars_of_interest Vector containing the names of the variables to be compared on their means
#' @param sample_size The range of sample size to be used
#' @return list with correlations and credible intervals for given sample_size
#' @returns list with correlations and credible intervals for given sample_size
#' @noRd

sample_corr <- function(data, vars_of_interest, sample_size){
Expand Down
2 changes: 1 addition & 1 deletion R/sample_diff.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' @param vars_of_interest Vector containing the names of the variables to be
#' compared on their means
#' @param sample_size The range of sample size to be used
#' @return list with estimate, variance, stdev, sterror, lower, upper values for
#' @returns list with estimate, variance, stdev, sterror, lower, upper values for
#' unstandardized differences as well as Cohen's d for given sample_size
#' @noRd

Expand Down
16 changes: 14 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,25 @@ Klapwijk, E. T., Jongerling, J., Hoijtink, H., & Crone, E. (2024, July 9). Sampl

## Installation

You can install the development version of neuroUp from [GitHub](https://github.com/) with:
Run the following in R:

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

Or you can install the latest development version of neuroUp from [GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
install.packages("devtools")
devtools::install_github("eduardklap/neuroUp")
```

Then run the following to get started:

```r
library(neuroUp)
```

## Citation

To cite package neuroUp in publications use:
Expand Down
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,26 @@ Bayesian updating. <https://doi.org/10.31234/osf.io/cz32t>

## Installation

You can install the development version of neuroUp from
Run the following in R:

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

Or you can install the latest development version of neuroUp from
[GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
install.packages("devtools")
devtools::install_github("eduardklap/neuroUp")
```

Then run the following to get started:

``` r
library(neuroUp)
```

## Citation

To cite package neuroUp in publications use:
Expand Down
72 changes: 72 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
## R CMD check results

0 errors | 0 warnings | 1 note

* This is a new release.

### Additional notes

#### Notes returned after running `devtools::check(remote = TRUE, manual = TRUE)`:

❯ checking CRAN incoming feasibility ... [5s/18s] NOTE
Maintainer: ‘Eduard Klapwijk <[email protected]>’

New submission

❯ checking examples ... [14s/14s] NOTE
Examples with CPU (user + system) or elapsed time > 5s
user system elapsed
estim_diff 10.222 0.424 10.657

❯ checking HTML version of manual ... NOTE
Found the following HTML validation problems:
estim_corr.html:4:1 (estim_corr.Rd:5): Warning: <link> inserting "type" attribute
estim_corr.html:12:1 (estim_corr.Rd:5): Warning: <script> proprietary attribute "onload"
estim_corr.html:12:1 (estim_corr.Rd:5): Warning: <script> inserting "type" attribute
estim_corr.html:17:1 (estim_corr.Rd:5): Warning: <table> lacks "summary" attribute
estim_corr.html:36:1 (estim_corr.Rd:10): Warning: <table> lacks "summary" attribute
estim_diff.html:4:1 (estim_diff.Rd:5): Warning: <link> inserting "type" attribute
estim_diff.html:12:1 (estim_diff.Rd:5): Warning: <script> proprietary attribute "onload"
estim_diff.html:12:1 (estim_diff.Rd:5): Warning: <script> inserting "type" attribute
estim_diff.html:17:1 (estim_diff.Rd:5): Warning: <table> lacks "summary" attribute
estim_diff.html:37:1 (estim_diff.Rd:10): Warning: <table> lacks "summary" attribute
feedback.html:4:1 (feedback.Rd:6): Warning: <link> inserting "type" attribute
feedback.html:12:1 (feedback.Rd:6): Warning: <script> proprietary attribute "onload"
feedback.html:12:1 (feedback.Rd:6): Warning: <script> inserting "type" attribute
feedback.html:17:1 (feedback.Rd:6): Warning: <table> lacks "summary" attribute
gambling.html:4:1 (gambling.Rd:6): Warning: <link> inserting "type" attribute
gambling.html:12:1 (gambling.Rd:6): Warning: <script> proprietary attribute "onload"
gambling.html:12:1 (gambling.Rd:6): Warning: <script> inserting "type" attribute
gambling.html:17:1 (gambling.Rd:6): Warning: <table> lacks "summary" attribute
pipe.html:4:1 (pipe.Rd:5): Warning: <link> inserting "type" attribute
pipe.html:12:1 (pipe.Rd:5): Warning: <script> proprietary attribute "onload"
pipe.html:12:1 (pipe.Rd:5): Warning: <script> inserting "type" attribute
pipe.html:17:1 (pipe.Rd:5): Warning: <table> lacks "summary" attribute
pipe.html:19:1 (pipe.Rd:5): Warning: <h2> attribute "id" has invalid value "+25+26gt+3B+25"
pipe.html:35:1 (pipe.Rd:10): Warning: <table> lacks "summary" attribute
pipe.html:36:14 (pipe.Rd:10): Warning: <code> attribute "id" has invalid value "+25+26gt+3B+25_:_lhs"
pipe.html:40:14 (pipe.Rd:12): Warning: <code> attribute "id" has invalid value "+25+26gt+3B+25_:_rhs"
self_eval.html:4:1 (self_eval.Rd:6): Warning: <link> inserting "type" attribute
self_eval.html:12:1 (self_eval.Rd:6): Warning: <script> proprietary attribute "onload"
self_eval.html:12:1 (self_eval.Rd:6): Warning: <script> inserting "type" attribute
self_eval.html:17:1 (self_eval.Rd:6): Warning: <table> lacks "summary" attribute
vicar_char.html:4:1 (vicar_char.Rd:6): Warning: <link> inserting "type" attribute
vicar_char.html:12:1 (vicar_char.Rd:6): Warning: <script> proprietary attribute "onload"
vicar_char.html:12:1 (vicar_char.Rd:6): Warning: <script> inserting "type" attribute
vicar_char.html:17:1 (vicar_char.Rd:6): Warning: <table> lacks "summary" attribute

0 errors ✔ | 0 warnings ✔ | 3 notes ✖

*Author note on HTML validation problems:* Seems to be a problem on my local MacOS system (which was not fixed by updating roxygen2), not encountered on remote system checks.

#### Notes returned after running `devtools::check_win_devel()`:

* checking CRAN incoming feasibility ... [10s] NOTE
Maintainer: 'Eduard Klapwijk <[email protected]>'

New submission

* checking examples ... [26s] NOTE
Examples with CPU (user + system) or elapsed time > 10s
user system elapsed
estim_diff 19.04 2.04 21.1
4 changes: 2 additions & 2 deletions man/estim_corr.Rd

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

2 changes: 1 addition & 1 deletion man/gambling.Rd

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

2 changes: 1 addition & 1 deletion man/self_eval.Rd

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

4 changes: 2 additions & 2 deletions man/vicar_char.Rd

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

0 comments on commit 8546764

Please sign in to comment.