diff --git a/NAMESPACE b/NAMESPACE index 3b12598..9974c68 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -56,11 +56,9 @@ export(alr) export(alrInv) export(alrInv_array) export(alr_array) -export(as.list) export(basset) export(check_dims) export(clr_array) -export(coef) export(conjugateLinearModel) export(create_default_ilr_base) export(gather_array) @@ -112,8 +110,6 @@ export(pibble_tidy_samples) export(pibblefit) export(ppc) export(ppc_summary) -export(predict) -export(print) export(random_pibble_init) export(reapply_coord) export(refit) @@ -121,7 +117,6 @@ export(req) export(sample_prior) export(store_coord) export(summarise_posterior) -export(summary) export(to_alr) export(to_clr) export(to_ilr) diff --git a/R/fidofit_methods.R b/R/fidofit_methods.R index eeca7e4..8957425 100644 --- a/R/fidofit_methods.R +++ b/R/fidofit_methods.R @@ -121,17 +121,17 @@ summary_check_precomputed <- function(m, pars){ } -#' Summarise pibblefit or orthusfit object and print posterior quantiles -#' -#' Default calculates median, mean, 50\% and 95\% credible interval -#' -#' @param object an object of class pibblefit or orthusfit -#' @param ... other objects to be passed to `summary.pibblefit` or `summary.orthusfit` -#' @return A list if class is `pibblefit` or `orthusfit` -#' @export -summary <- function(object, ...){ - UseMethod("summary") -} +#' #' Summarise pibblefit or orthusfit object and print posterior quantiles +#' #' +#' #' Default calculates median, mean, 50\% and 95\% credible interval +#' #' +#' #' @param object an object of class pibblefit or orthusfit +#' #' @param ... other objects to be passed to `summary.pibblefit` or `summary.orthusfit` +#' #' @return A list if class is `pibblefit` or `orthusfit` +#' #' @export +#' summary <- function(object, ...){ +#' UseMethod("summary") +#' } #' Summarise pibblefit object and print posterior quantiles @@ -285,20 +285,20 @@ summary.orthusfit <- function(object, pars=NULL, use_names=TRUE, as_factor=FALSE } -#' Print dimensions and coordinate system information for an orthusfit or pibblefit object. -#' -#' @param x an object of class pibblefit or orthusfit -#' @param ... other arguments to pass to summary function -#' @return No direct value, but a print out -#' @export -#' @examples -#' sim <- pibble_sim() -#' fit <- pibble(sim$Y, sim$X) -#' print(fit) -#' -print <- function(x, ...){ - UseMethod("print") -} +#' #' Print dimensions and coordinate system information for an orthusfit or pibblefit object. +#' #' +#' #' @param x an object of class pibblefit or orthusfit +#' #' @param ... other arguments to pass to summary function +#' #' @return No direct value, but a print out +#' #' @export +#' #' @examples +#' #' sim <- pibble_sim() +#' #' fit <- pibble(sim$Y, sim$X) +#' #' print(fit) +#' #' +#' print <- function(x, ...){ +#' UseMethod("print") +#' } #' Print dimensions and coordinate system information for pibblefit object. @@ -403,22 +403,22 @@ print.orthusfit <- function(x, summary=FALSE, ...){ } -#' Return regression coefficients of pibblefit or orthusfit object - -#' -#' @param object an object of class pibblefit or orthusfit -#' @param ... other options passed to coef.pibblefit or coef.orthusfit (see details) -#' @return Array of dimension (D-1) x Q x iter -#' -#' @export -#' @examples -#' sim <- pibble_sim() -#' fit <- pibble(sim$Y, sim$X) -#' coef(fit) -#' -coef <- function(object, ...){ - UseMethod("coef") -} +#' #' Return regression coefficients of pibblefit or orthusfit object +#' +#' #' +#' #' @param object an object of class pibblefit or orthusfit +#' #' @param ... other options passed to coef.pibblefit or coef.orthusfit (see details) +#' #' @return Array of dimension (D-1) x Q x iter +#' #' +#' #' @export +#' #' @examples +#' #' sim <- pibble_sim() +#' #' fit <- pibble(sim$Y, sim$X) +#' #' coef(fit) +#' #' +#' coef <- function(object, ...){ +#' UseMethod("coef") +#' } @@ -476,16 +476,16 @@ coef.orthusfit <- function(object, ...){ -#' Generic method to convert to list -#' -#' @param x An object of class pibblefit or orthusfit -#' @param ... Other objects to pass -#' -#' @return A list object -#' @export -as.list <- function(x, ...){ - UseMethod("as.list") -} +#' #' Generic method to convert to list +#' #' +#' #' @param x An object of class pibblefit or orthusfit +#' #' @param ... Other objects to pass +#' #' +#' #' @return A list object +#' #' @export +#' as.list <- function(x, ...){ +#' UseMethod("as.list") +#' } #' Convert object of class pibblefit to a list @@ -516,24 +516,24 @@ as.list.orthusfit <- function(x,...){ -#' Predict response from new data -#' -#' -#' @param object An object of class pibblefit -#' @param ... Other objects to be passed to the `predict` function -#' -#' @return (if summary==FALSE) array D x N x iter; (if summary==TRUE) -#' tibble with calculated posterior summaries -#' -#' @export -#' @importFrom stats median predict runif -#' @examples -#' sim <- pibble_sim() -#' fit <- pibble(sim$Y, sim$X) -#' predict(fit)[,,1:2] # just show 2 samples -predict <- function(object, ...){ - UseMethod("predict") -} +#' #' Predict response from new data +#' #' +#' #' +#' #' @param object An object of class pibblefit +#' #' @param ... Other objects to be passed to the `predict` function +#' #' +#' #' @return (if summary==FALSE) array D x N x iter; (if summary==TRUE) +#' #' tibble with calculated posterior summaries +#' #' +#' #' @export +#' #' @importFrom stats median predict runif +#' #' @examples +#' #' sim <- pibble_sim() +#' #' fit <- pibble(sim$Y, sim$X) +#' #' predict(fit)[,,1:2] # just show 2 samples +#' predict <- function(object, ...){ +#' UseMethod("predict") +#' } @@ -644,6 +644,9 @@ predict.pibblefit <- function(object, newdata=NULL, response="LambdaX", size=NUL # Draw Eta Eta <- array(0, dim=dim(LambdaX)) zEta <- array(rnorm((object$D-1)*nnew*iter), dim = dim(Eta)) + if(is.null(object$Sigma)){ + print("Sigma is needed to predict either Eta or Y.") + } for (i in 1:iter){ Eta[,,i] <- LambdaX[,,i] + t(chol(object$Sigma[,,i]))%*%zEta[,,i] } diff --git a/configure.ac.bak b/configure.ac.bak new file mode 100644 index 0000000..b364e0a --- /dev/null +++ b/configure.ac.bak @@ -0,0 +1,218 @@ +# autoconf file inspiration from +# https://github.com/USCbiostats/software-dev/wiki/Setting-up-optional-OpenMP-support +# EDIT: who are we kidding we didn't take inspiration from the above, we just shamelessly stole and minimally +# modified the RcppArmadillo configure.ac file that others have perfected. +# https://github.com/RcppCore/RcppArmadillo/blob/master/configure.ac + +AC_PREREQ([2.69]) +AC_INIT(fido, m4_esyscmd_s([awk '/^Version:/ {print $2}' DESCRIPTION])) + +## Set R_HOME, respecting an environment variable if one is set +: ${R_HOME=$(R RHOME)} +if test -z "${R_HOME}"; then + AC_MSG_ERROR([Could not determine R_HOME.]) +fi + +## Use R to set CXX and CXXFLAGS +CXX=$(${R_HOME}/bin/R CMD config CXX) +CXXFLAGS=$("${R_HOME}/bin/R" CMD config CXXFLAGS) + +## We are using C++ +AC_LANG(C++) +AC_REQUIRE_CPP +AC_PROG_CXX + +## Is R already configured to compile things using OpenMP without +## any extra hand-holding? +openmp_already_works="no" + +## default to not even thinking about OpenMP as Armadillo wants a pragma +## variant available if and only if C++11 is used with g++ 5.4 or newer +can_use_openmp="no" + +## Ensure TMPDIR is set. +AC_MSG_CHECKING([whether we have a suitable tempdir]) +TMPDIR=$("${R_HOME}/bin/R" --vanilla --slave -e "cat(dirname(tempdir()))") +AC_MSG_RESULT([${TMPDIR}]) + +## Check if R is configured to compile programs using OpenMP out-of-the-box. +AC_MSG_CHECKING([whether R CMD SHLIB can already compile programs using OpenMP]) + +## Create private directory in TMPDIR. +BUILDDIR="${TMPDIR}/rcpparmadillo-$$-$RANDOM" +mkdir -p "${BUILDDIR}" + +owd=$(pwd) +cd "${BUILDDIR}" + +cat < test-omp.cpp +#include +int main() { + return omp_get_num_threads(); +} +EOF + +## Execute R CMD SHLIB. +"${R_HOME}/bin/R" CMD SHLIB test-omp.cpp >/dev/null 2>&1 +if test x"$?" = x"0"; then + AC_MSG_RESULT([yes]) + openmp_already_works="yes" +else + AC_MSG_RESULT([no]) +fi + +## Go back home. +cd "${owd}" +rm -rf "${BUILDDIR}" + + +## additional reporting/diagnostics for mac don't trust the above approach for mac +RSysinfoName=$("${R_HOME}/bin/Rscript" --vanilla -e 'cat(Sys.info()[["sysname"]])') +AC_MSG_CHECKING([for mac OS]) +if test x"${RSysinfoName}" = x"Darwin"; then + AC_MSG_RESULT([found, not trusting "already works"]) + openmp_already_works="no" +else + AC_MSG_RESULT([not found]) +fi # end mac check + + +## If the above checks failed, then perform other heuristics +## based on the compiler version, etc. +if test x"${openmp_already_works}" = x"no"; then + + ## Check the C++ compiler using the CXX value set + + ## If it is g++, we have GXX set so let's examine it + if test "${GXX}" = yes; then + AC_MSG_CHECKING([whether g++ version is sufficient]) + gxx_version=$(${CXX} -v 2>&1 | awk '/^.*g.. version/ {print $3}') + case ${gxx_version} in + 1.*|2.*|3.*|4.0.*|4.1.*|4.2.*|4.3.*|4.4.*|4.5.*|4.6.*|4.7.0|4.7.1) + AC_MSG_RESULT([no]) + AC_MSG_WARN([Only g++ version 4.7.2 or greater can be used with RcppArmadillo.]) + AC_MSG_ERROR([Please use a different compiler.]) + ;; + 4.7.*|4.8.*|4.9.*|5.0*|5.1*|5.2*|5.3*) + AC_MSG_RESULT([yes, but without OpenMP as version ${gxx_version} (Armadillo constraint)]) + ## we know this one is bad + can_use_openmp="no" + ;; + 5.4*|5.5*|5.6*|5.7*|5.8*|5.9*|6.*|7.*|8.*|9.*|10.*|11.*|12.*) + AC_MSG_RESULT([yes, with OpenMP as version ${gxx_version}]) + ## we know this one is good, yay + can_use_openmp="yes" + ;; + *) + AC_MSG_RESULT([almost]) + AC_MSG_WARN([Compiler self-identifies as being compliant with GNUC extensions but is not g++.]) + ## we know nothing, so no + can_use_openmp="no" + ;; + esac + fi + + ## Check for Apple LLVM + + AC_MSG_CHECKING([for macOS]) + RSysinfoName=$("${R_HOME}/bin/Rscript" --vanilla -e 'cat(Sys.info()[["sysname"]])') + + if test x"${RSysinfoName}" = x"Darwin"; then + AC_MSG_RESULT([found]) + AC_MSG_CHECKING([for macOS Apple compiler]) + + apple_compiler=$($CXX --version 2>&1 | grep -i -c -e 'apple llvm') + + if test x"${apple_compiler}" = x"1"; then + AC_MSG_RESULT([found]) + AC_MSG_WARN([OpenMP unavailable and turned off.]) + can_use_openmp="no" + else + AC_MSG_RESULT([not found]) + AC_MSG_CHECKING([for clang compiler]) + clang_compiler=$($CXX --version 2>&1 | grep -i -c -e 'clang ') + + if test x"${clang_compiler}" = x"1"; then + AC_MSG_RESULT([found]) + AC_MSG_CHECKING([for OpenMP compatible version of clang]) + clang_version=$(${CXX} -v 2>&1 | awk '/^.*clang version/ {print $3}') + + case ${clang_version} in + 4.*|5.*|6.*|7.*|8.*|9.*|10.*|11.*) + AC_MSG_RESULT([found and suitable]) + can_use_openmp="yes" + ;; + *) + AC_MSG_RESULT([not found]) + AC_MSG_WARN([OpenMP unavailable and turned off.]) + can_use_openmp="no" + ;; + esac + else + AC_MSG_RESULT([not found]) + AC_MSG_WARN([unsupported macOS build detected; if anything breaks, you keep the pieces.]) + fi + fi + else + AC_MSG_RESULT([no]) + fi + +fi # if test x"${openmp_already_works}" = x"no" + +## Check for suitable LAPACK_LIBS +AC_MSG_CHECKING([LAPACK_LIBS]) + +## external LAPACK has the required function +lapack=$(${R_HOME}/bin/R CMD config LAPACK_LIBS) +hasRlapack=$(echo ${lapack} | grep lRlapack) + +## in what follows below we substitute both side of the define/undef +## while this may seem a little unusual we do it to fully reproduce the +## previous bash-based implementation + +if test x"${hasRlapack}" = x""; then + ## We are using a full Lapack and can use zgbsv -- so #undef remains + AC_MSG_RESULT([system LAPACK found]) + arma_lapack="#undef ARMA_CRIPPLED_LAPACK" +else + ## We are using R's subset of Lapack and CANNOT use zgbsv etc, so we mark it + AC_MSG_RESULT([R-supplied partial LAPACK found]) + AC_MSG_WARN([Some complex-valued LAPACK functions may not be available]) + arma_lapack="#define ARMA_CRIPPLED_LAPACK 1" +fi + +## Default the OpenMP flag to the empty string. +## If and only if OpenMP is found, expand to $(SHLIB_OPENMP_CXXFLAGS) +openmp_flag="" + +## Set the fallback, by default it is nope +arma_have_openmp="#define ARMA_DONT_USE_OPENMP 1" + +if test x"${openmp_already_works}" = x"yes"; then + arma_have_openmp="#define ARMA_USE_OPENMP" + ## Added by JDS + openmp_flag='$(SHLIB_OPENMP_CXXFLAGS)' +fi + +if test x"${can_use_openmp}" = x"yes"; then + AC_MSG_CHECKING([for OpenMP]) + ## if R has -fopenmp we should be good + allldflags=$(${R_HOME}/bin/R CMD config --ldflags) + hasOpenMP=$(echo ${allldflags} | grep -- -fopenmp) + if test x"${hasOpenMP}" = x""; then + AC_MSG_RESULT([missing]) + arma_have_openmp="#define ARMA_DONT_USE_OPENMP" + else + AC_MSG_RESULT([found and suitable]) + arma_have_openmp="#define ARMA_USE_OPENMP" + openmp_flag='$(SHLIB_OPENMP_CXXFLAGS)' + fi +fi + + +## now use all these +AC_SUBST([ARMA_LAPACK],["${arma_lapack}"]) +AC_SUBST([ARMA_HAVE_OPENMP], ["${arma_have_openmp}"]) +AC_SUBST([OPENMP_FLAG], ["${openmp_flag}"]) +AC_CONFIG_FILES([inst/include/fidoGenerated.h src/Makevars]) +AC_OUTPUT diff --git a/man/as.list.Rd b/man/as.list.Rd deleted file mode 100644 index fa05a5e..0000000 --- a/man/as.list.Rd +++ /dev/null @@ -1,19 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/fidofit_methods.R -\name{as.list} -\alias{as.list} -\title{Generic method to convert to list} -\usage{ -as.list(x, ...) -} -\arguments{ -\item{x}{An object of class pibblefit or orthusfit} - -\item{...}{Other objects to pass} -} -\value{ -A list object -} -\description{ -Generic method to convert to list -} diff --git a/man/as.list.pibblefit.Rd b/man/as.list.pibblefit.Rd index e8d8f26..61d928a 100644 --- a/man/as.list.pibblefit.Rd +++ b/man/as.list.pibblefit.Rd @@ -2,7 +2,17 @@ % Please edit documentation in R/fidofit_methods.R \name{as.list.pibblefit} \alias{as.list.pibblefit} -\title{Convert object of class pibblefit to a list} +\title{#' Generic method to convert to list +#' +#' @param x An object of class pibblefit or orthusfit +#' @param ... Other objects to pass +#' +#' @return A list object +#' @export +as.list <- function(x, ...){ + UseMethod("as.list") +} +Convert object of class pibblefit to a list} \usage{ \method{as.list}{pibblefit}(x, ...) } @@ -15,5 +25,15 @@ A list from the converted pibblefit object. } \description{ +#' Generic method to convert to list +#' +#' @param x An object of class pibblefit or orthusfit +#' @param ... Other objects to pass +#' +#' @return A list object +#' @export +as.list <- function(x, ...){ + UseMethod("as.list") +} Convert object of class pibblefit to a list } diff --git a/man/coef.Rd b/man/coef.Rd deleted file mode 100644 index 16d4e55..0000000 --- a/man/coef.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/fidofit_methods.R -\name{coef} -\alias{coef} -\title{Return regression coefficients of pibblefit or orthusfit object} -\usage{ -coef(object, ...) -} -\arguments{ -\item{object}{an object of class pibblefit or orthusfit} - -\item{...}{other options passed to coef.pibblefit or coef.orthusfit (see details)} -} -\value{ -Array of dimension (D-1) x Q x iter -} -\description{ -Return regression coefficients of pibblefit or orthusfit object -} -\examples{ -sim <- pibble_sim() -fit <- pibble(sim$Y, sim$X) -coef(fit) - -} diff --git a/man/coef.pibblefit.Rd b/man/coef.pibblefit.Rd index 197f7e6..cedfa87 100644 --- a/man/coef.pibblefit.Rd +++ b/man/coef.pibblefit.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/fidofit_methods.R \name{coef.pibblefit} \alias{coef.pibblefit} -\title{Return regression coefficients of pibblefit object} +\title{#' Return regression coefficients of pibblefit or orthusfit object} \usage{ \method{coef}{pibblefit}(object, ...) } @@ -15,10 +15,26 @@ Array of dimension (D-1) x Q x iter } \description{ -Pibble: Returned as array of dimension (D-1) x Q x iter (if in ALR or ILR) otherwise -DxQxiter (if in proportions or clr). +#' +#' @param object an object of class pibblefit or orthusfit +#' @param ... other options passed to coef.pibblefit or coef.orthusfit (see details) +#' @return Array of dimension (D-1) x Q x iter +#' +#' @export +#' @examples +#' sim <- pibble_sim() +#' fit <- pibble(sim$Y, sim$X) +#' coef(fit) +#' +coef <- function(object, ...){ + UseMethod("coef") +} +Return regression coefficients of pibblefit object } \details{ +Pibble: Returned as array of dimension (D-1) x Q x iter (if in ALR or ILR) otherwise +DxQxiter (if in proportions or clr). + Other arguments: \itemize{ \item `use_names` if column and row names were passed for Y and X in diff --git a/man/predict.Rd b/man/predict.Rd deleted file mode 100644 index 2516357..0000000 --- a/man/predict.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/fidofit_methods.R -\name{predict} -\alias{predict} -\title{Predict response from new data} -\usage{ -predict(object, ...) -} -\arguments{ -\item{object}{An object of class pibblefit} - -\item{...}{Other objects to be passed to the `predict` function} -} -\value{ -(if summary==FALSE) array D x N x iter; (if summary==TRUE) -tibble with calculated posterior summaries -} -\description{ -Predict response from new data -} -\examples{ -sim <- pibble_sim() -fit <- pibble(sim$Y, sim$X) -predict(fit)[,,1:2] # just show 2 samples -} diff --git a/man/predict.pibblefit.Rd b/man/predict.pibblefit.Rd index 210071d..c6077da 100644 --- a/man/predict.pibblefit.Rd +++ b/man/predict.pibblefit.Rd @@ -2,7 +2,25 @@ % Please edit documentation in R/fidofit_methods.R \name{predict.pibblefit} \alias{predict.pibblefit} -\title{Predict response from new data} +\title{#' Predict response from new data +#' +#' +#' @param object An object of class pibblefit +#' @param ... Other objects to be passed to the `predict` function +#' +#' @return (if summary==FALSE) array D x N x iter; (if summary==TRUE) +#' tibble with calculated posterior summaries +#' +#' @export +#' @importFrom stats median predict runif +#' @examples +#' sim <- pibble_sim() +#' fit <- pibble(sim$Y, sim$X) +#' predict(fit)[,,1:2] # just show 2 samples +predict <- function(object, ...){ + UseMethod("predict") +} +Predict response from new data} \usage{ \method{predict}{pibblefit}( object, @@ -46,6 +64,24 @@ predictions of Eta from posterior of Lambda? (default: false)} tibble with calculated posterior summaries } \description{ +#' Predict response from new data +#' +#' +#' @param object An object of class pibblefit +#' @param ... Other objects to be passed to the `predict` function +#' +#' @return (if summary==FALSE) array D x N x iter; (if summary==TRUE) +#' tibble with calculated posterior summaries +#' +#' @export +#' @importFrom stats median predict runif +#' @examples +#' sim <- pibble_sim() +#' fit <- pibble(sim$Y, sim$X) +#' predict(fit)[,,1:2] # just show 2 samples +predict <- function(object, ...){ + UseMethod("predict") +} Predict response from new data } \details{ diff --git a/man/print.Rd b/man/print.Rd deleted file mode 100644 index 4dc2256..0000000 --- a/man/print.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/fidofit_methods.R -\name{print} -\alias{print} -\title{Print dimensions and coordinate system information for an orthusfit or pibblefit object.} -\usage{ -print(x, ...) -} -\arguments{ -\item{x}{an object of class pibblefit or orthusfit} - -\item{...}{other arguments to pass to summary function} -} -\value{ -No direct value, but a print out -} -\description{ -Print dimensions and coordinate system information for an orthusfit or pibblefit object. -} -\examples{ -sim <- pibble_sim() -fit <- pibble(sim$Y, sim$X) -print(fit) - -} diff --git a/man/print.pibblefit.Rd b/man/print.pibblefit.Rd index 3fc6f38..9c3e3bb 100644 --- a/man/print.pibblefit.Rd +++ b/man/print.pibblefit.Rd @@ -2,7 +2,21 @@ % Please edit documentation in R/fidofit_methods.R \name{print.pibblefit} \alias{print.pibblefit} -\title{Print dimensions and coordinate system information for pibblefit object.} +\title{#' Print dimensions and coordinate system information for an orthusfit or pibblefit object. +#' +#' @param x an object of class pibblefit or orthusfit +#' @param ... other arguments to pass to summary function +#' @return No direct value, but a print out +#' @export +#' @examples +#' sim <- pibble_sim() +#' fit <- pibble(sim$Y, sim$X) +#' print(fit) +#' +print <- function(x, ...){ + UseMethod("print") +} +Print dimensions and coordinate system information for pibblefit object.} \usage{ \method{print}{pibblefit}(x, summary = FALSE, ...) } @@ -17,6 +31,20 @@ No direct return, prints out summary } \description{ +#' Print dimensions and coordinate system information for an orthusfit or pibblefit object. +#' +#' @param x an object of class pibblefit or orthusfit +#' @param ... other arguments to pass to summary function +#' @return No direct value, but a print out +#' @export +#' @examples +#' sim <- pibble_sim() +#' fit <- pibble(sim$Y, sim$X) +#' print(fit) +#' +print <- function(x, ...){ + UseMethod("print") +} Print dimensions and coordinate system information for pibblefit object. } \examples{ diff --git a/man/summary.Rd b/man/summary.Rd deleted file mode 100644 index efdeede..0000000 --- a/man/summary.Rd +++ /dev/null @@ -1,19 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/fidofit_methods.R -\name{summary} -\alias{summary} -\title{Summarise pibblefit or orthusfit object and print posterior quantiles} -\usage{ -summary(object, ...) -} -\arguments{ -\item{object}{an object of class pibblefit or orthusfit} - -\item{...}{other objects to be passed to `summary.pibblefit` or `summary.orthusfit`} -} -\value{ -A list if class is `pibblefit` or `orthusfit` -} -\description{ -Default calculates median, mean, 50\% and 95\% credible interval -} diff --git a/man/summary.pibblefit.Rd b/man/summary.pibblefit.Rd index 65dd40d..db55fc6 100644 --- a/man/summary.pibblefit.Rd +++ b/man/summary.pibblefit.Rd @@ -2,7 +2,18 @@ % Please edit documentation in R/fidofit_methods.R \name{summary.pibblefit} \alias{summary.pibblefit} -\title{Summarise pibblefit object and print posterior quantiles} +\title{#' Summarise pibblefit or orthusfit object and print posterior quantiles +#' +#' Default calculates median, mean, 50\% and 95\% credible interval +#' +#' @param object an object of class pibblefit or orthusfit +#' @param ... other objects to be passed to `summary.pibblefit` or `summary.orthusfit` +#' @return A list if class is `pibblefit` or `orthusfit` +#' @export +summary <- function(object, ...){ + UseMethod("summary") +} +Summarise pibblefit object and print posterior quantiles} \usage{ \method{summary}{pibblefit}( object, diff --git a/tests/testthat/Rplots.pdf b/tests/testthat/Rplots.pdf index 2418752..c9b1942 100644 Binary files a/tests/testthat/Rplots.pdf and b/tests/testthat/Rplots.pdf differ