R/utils.R

Defines functions diagOfVcov .capturePrint .formatNameNumeric .reportClassName

## Do not edit this file manually.
## It has been automatically generated from *.org sources.

## taken from "pcts"
##
## This is called by show() methods, so it is save to use 'class(object) == class'.
## Nevertheless (2020-02-29), change the test to 'class(object)[1] == class' to make it
## suitable for S3 methods, as well.
##
## Note: inherits(object, class) is not suitable here.
.reportClassName <- function(object, class, trailer = "\n"){
    if(class(object)[1] == class)
        cat('An object of class "', class, '"', trailer, sep = "")
    NULL
}

## s - character string.
## v - numeric vector.
## none - character string.
.formatNameNumeric <- function(s, v, none = " <None>"){
    if(length(v) == 0)
        paste0(s, none)
    else{
        wrk <- paste0(v, collapse=" ")
        paste0(s, wrk)
    }
}

.capturePrint <- function(x){ # used by show() methods to print polynomials
    capture.output(print(x))
}

# stats:::format.perc() is not exported, copy it here.
.stats.format.perc <- function (probs, digits)
    paste(format(100 * probs, trim = TRUE, scientific = FALSE, digits = digits), "%")

diagOfVcov <- function(object, ...){
    diag(vcov(object, ...))
}

setGeneric("diagOfVcov")

Try the sarima package in your browser

Any scripts or data that you put into this service are public.

sarima documentation built on Aug. 11, 2022, 5:11 p.m.