diff --git a/.Rbuildignore b/.Rbuildignore index a4d2bb7..5c0e619 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -10,3 +10,4 @@ Makefile ^LICENSE\.md$ ^gptoolsStan\.Rcheck$ ^.*?\.tar\.gz$ +^playground$ diff --git a/.gitignore b/.gitignore index fcc32a0..b08d40e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ build .DS_Store CRAN-SUBMISSION .Rhistory +playground diff --git a/DESCRIPTION b/DESCRIPTION index 0ac06f0..f330abf 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: gptoolsStan -Title: Gaussian Processes on Graphs and Lattices in Stan +Title: Gaussian Processes on Graphs and Lattices in 'Stan' Version: 0.1.0 Authors@R: c( person("Till", "Hoffmann", , "thoffmann@hsph.harvard.edu", role = c("aut", "cre"), @@ -8,9 +8,11 @@ Authors@R: c( comment = c(ORCID = "0000-0001-6613-8668"))) Description: Gaussian processes are flexible distributions to model functional data. Whilst theoretically appealing, they are computationally cumbersome except for small datasets. - This package implements two methods for scaling GP inference in Stan. First, a sparse - approximation of the likelihood that is generally applicable and, second, an exact method for - regularly spaced data modeled by stationary kernels using fast Fourier methods. + This package implements two methods for scaling Gaussian process inference in 'Stan'. First, a + sparse approximation of the likelihood that is generally applicable and, second, an exact method + for regularly spaced data modeled by stationary kernels using fast Fourier methods. Utility + functions are provided to compile and fit 'Stan' models using the 'cmdstanr' interface. + References: Hoffmann and Onnela (2022) . License: MIT + file LICENSE Encoding: UTF-8 Language: en-US diff --git a/R/model.R b/R/model.R index 921b637..113eb4e 100644 --- a/R/model.R +++ b/R/model.R @@ -1,6 +1,18 @@ -#' Get the gptools include path for compiling Stan programs with `cmdstanr`. +#' Get the 'gptoolsStan' include path for compiling 'Stan' programs. #' #' @export +#' @return Path to the directory containing source files for 'gptoolsStan' as characters. +#' @examples +#' \dontrun{ +#' library(cmdstanr) +#' library(gptoolsStan) +#' +#' # Compile the model with paths set up to include 'Stan' sources from 'gptoolsStan'. +#' model <- cmdstan_model( +#' stan_file="/path/to/your/model.stan", +#' include_paths=gptools_include_path(), +#' ) +#' } gptools_include_path <- function() { system.file("extdata", package="gptoolsStan") } diff --git a/cran-comments.md b/cran-comments.md index 858617d..ac26b95 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,4 +1,36 @@ -## R CMD check results +# Revisions in response to comments from 2023-12-18 for resubmission of 0.1.0. + +Thank you for the comments. Please find point-by-point responses below. Code changes are available at https://github.com/onnela-lab/gptoolsStan/pull/4. + +> Please always write package names, software names and API (application programming interface) names in single quotes in title and description. e.g: --> 'Stan' Please note that package names are case sensitive. + +We have wrapped 'Stan' and 'cmdstanr' in single quotes. + +> Please always explain all acronyms in the description text. -> 'GP' + +We have expanded acronyms. + +> If there are references describing the methods in your package, please add these in the description field of your DESCRIPTION file in the form +> authors (year) +> authors (year) +> authors (year, ISBN:...) +> or if those are not available: +> with no space after 'doi:', 'arXiv:', 'https:' and angle brackets for auto-linking. (If you want to add a title as well please put it in quotes: "Title") + +We have added a reference. + +> Please add `\value` to `.Rd` files regarding exported methods and explain the functions results in the documentation. Please write about the structure of the output (class) and also what the output means. (If a function does not return a value, please document that too, e.g. `\value{No return value, called for side effects}` or similar) +> Missing Rd-tags: +> +> - `gptools_include_path.Rd: \value` + +We have added a `\value` tag. + +> Please add small executable examples in your Rd-files to illustrate the use of the exported function but also enable automatic testing. + +We have added an example to the `.Rd` files. It is however wrapped in `\dontrun` because running the example requires that 'cmdstan' and 'cmdstanr' are installed. + +# R CMD check results for first submission 0.1.0. 0 errors | 0 warnings | 1 note diff --git a/man/gptools_include_path.Rd b/man/gptools_include_path.Rd index eef83cf..e5e5324 100644 --- a/man/gptools_include_path.Rd +++ b/man/gptools_include_path.Rd @@ -2,10 +2,25 @@ % Please edit documentation in R/model.R \name{gptools_include_path} \alias{gptools_include_path} -\title{Get the gptools include path for compiling Stan programs with \code{cmdstanr}.} +\title{Get the 'gptoolsStan' include path for compiling 'Stan' programs.} \usage{ gptools_include_path() } +\value{ +Path to the directory containing source files for 'gptoolsStan' as characters. +} \description{ -Get the gptools include path for compiling Stan programs with \code{cmdstanr}. +Get the 'gptoolsStan' include path for compiling 'Stan' programs. +} +\examples{ +\dontrun{ +library(cmdstanr) +library(gptoolsStan) + +# Compile the model with paths set up to include 'Stan' sources from 'gptoolsStan'. +model <- cmdstan_model( + stan_file="/path/to/your/model.stan", + include_paths=gptools_include_path(), +) +} }