new version, fixed print.win_Prob

This commit is contained in:
Andreas Gammelgaard Damsbo 2023-05-17 14:40:51 +02:00
parent db863d03ae
commit b1ba172420
5 changed files with 31 additions and 7 deletions

View File

@ -1,6 +1,6 @@
Package: stRoke Package: stRoke
Title: Clinical Stroke Research Title: Clinical Stroke Research
Version: 23.4.1 Version: 23.5.1
Authors@R: Authors@R:
person("Andreas Gammelgaard", "Damsbo", , "agdamsbo@clin.au.dk", role = c("aut", "cre"), person("Andreas Gammelgaard", "Damsbo", , "agdamsbo@clin.au.dk", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-7559-1154")) comment = c(ORCID = "0000-0002-7559-1154"))

View File

@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand # Generated by roxygen2: do not edit by hand
S3method(print,win_Prob)
export(age_calc) export(age_calc)
export(ci_plot) export(ci_plot)
export(contrast_text) export(contrast_text)

View File

@ -167,12 +167,16 @@ win_prob <-
dec = dec dec = dec
) )
) )
class(out) <- c("win_Prop", class(out)) class(out) <- c("win_Prob", class(out))
return(out) return(out)
} }
#' @title PRints win_prob results
print.win_Prop <- function (x, ...) { #' @param x win_prob results.
#' @param ... ignored for now
#' @return Prints win_prob statistics.
#' @export
print.win_Prob <- function (x, ...) {
args <- list(...) args <- list(...)
cat("\t Zou et al's winP (doi: 10.1161/STROKEAHA.121.037744) \n\n") cat("\t Zou et al's winP (doi: 10.1161/STROKEAHA.121.037744) \n\n")

19
man/print.win_Prob.Rd Normal file
View File

@ -0,0 +1,19 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/win_prob.R
\name{print.win_Prob}
\alias{print.win_Prob}
\title{PRints win_prob results}
\usage{
\method{print}{win_Prob}(x, ...)
}
\arguments{
\item{x}{win_prob results.}
\item{...}{ignored for now}
}
\value{
Prints win_prob statistics.
}
\description{
PRints win_prob results
}

View File

@ -32,7 +32,7 @@ test_that("Output length is 16, and print works", {
sample.size = TRUE, sample.size = TRUE,
print.tables = TRUE) print.tables = TRUE)
expect_length(result, 16) expect_length(result, 16)
expect_s3_class(result, "win_Prop") expect_s3_class(result, "win_Prob")
expect_output(print.win_Prop(result)) expect_output(print.win_Prob(result))
}) })