Skip to content

Commit ba6e083

Browse files
committed
bump version
1 parent fb9f036 commit ba6e083

File tree

76 files changed

+2547
-3606
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+2547
-3606
lines changed

.github/workflows/r-release-check.yml

Lines changed: 18 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,31 @@
1-
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
2-
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
5-
branches:
6-
- main
7-
- master
5+
branches: [main, master]
86
pull_request:
9-
branches:
10-
- main
11-
- master
7+
branches: [main, master]
128

139
name: R-CMD-check
1410

1511
jobs:
1612
R-CMD-check:
17-
runs-on: macOS-latest
18-
#env:
19-
# GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
13+
runs-on: ubuntu-latest
14+
env:
15+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
16+
R_KEEP_PKG_SOURCE: yes
2017
steps:
21-
- uses: actions/checkout@v2
22-
- uses: r-lib/actions/setup-r@v1
23-
- uses: r-lib/actions/setup-pandoc@v1
18+
- uses: actions/checkout@v3
2419

25-
- name: Query dependencies
26-
run: |
27-
install.packages('remotes')
28-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
29-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
30-
shell: Rscript {0}
31-
32-
- name: Cache R packages
33-
uses: actions/cache@v2
20+
- uses: r-lib/actions/setup-r@v2
3421
with:
35-
path: ${{ env.R_LIBS_USER }}
36-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
37-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
38-
39-
- name: Install dependencies
40-
run: |
41-
install.packages(c("remotes", "rcmdcheck"))
42-
remotes::install_deps(dependencies = TRUE)
43-
remotes::install_cran("covr")
44-
shell: Rscript {0}
22+
use-public-rspm: true
4523

46-
- name: Check
47-
run: |
48-
options(crayon.enabled = TRUE)
49-
rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")
50-
shell: Rscript {0}
24+
- uses: r-lib/actions/setup-r-dependencies@v2
25+
with:
26+
extra-packages: |
27+
any::rcmdcheck
28+
any::XML
29+
needs: check
5130

52-
- name: Test coverage
53-
run: covr::codecov()
54-
shell: Rscript {0}
31+
- uses: r-lib/actions/check-r-package@v2

DESCRIPTION

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@ Type: Package
22
Package: ezcox
33
Title: Easily Process a Batch of Cox Models
44
Version: 1.0.4
5-
Date: 2022-8-16
5+
Date: 2023-5-8
66
Authors@R:
7-
person(given = "Shixiang",
8-
family = "Wang",
9-
role = c("aut", "cre"),
10-
email = "[email protected]",
7+
person("Shixiang", "Wang", , "[email protected]", role = c("aut", "cre"),
118
comment = c(ORCID = "0000-0001-9855-7357"))
129
Maintainer: Shixiang Wang <[email protected]>
1310
Description: A tool to operate a batch of univariate or multivariate Cox
@@ -22,26 +19,27 @@ Imports:
2219
forestmodel,
2320
ggplot2,
2421
magrittr (>= 1.5),
22+
methods,
2523
purrr (>= 0.3.2),
2624
rlang (>= 0.1.2),
2725
scales,
2826
survival,
2927
tibble,
30-
utils,
31-
utf8
28+
utf8,
29+
utils
3230
Suggests:
3331
covr (>= 3.2.1),
3432
furrr,
3533
future,
3634
knitr,
35+
prettydoc,
3736
rmarkdown,
3837
roxygen2 (>= 6.1.1),
39-
testthat (>= 2.1.0),
40-
prettydoc
38+
testthat (>= 2.1.0)
4139
VignetteBuilder:
4240
knitr
4341
Encoding: UTF-8
4442
LazyData: true
4543
Roxygen: list(markdown = TRUE, roclets = c("collate", "namespace", "rd",
4644
"roxytest::testthat_roclet"))
47-
RoxygenNote: 7.1.1
45+
RoxygenNote: 7.2.3

NAMESPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ importFrom(dplyr,if_else)
2727
importFrom(dplyr,tibble)
2828
importFrom(magrittr,"%<>%")
2929
importFrom(magrittr,"%>%")
30+
importFrom(methods,is)
3031
importFrom(purrr,map2_df)
3132
importFrom(rlang,":=")
3233
importFrom(rlang,.data)
@@ -38,4 +39,5 @@ importFrom(rlang,expr)
3839
importFrom(rlang,sym)
3940
importFrom(rlang,syms)
4041
importFrom(stats,as.formula)
42+
importFrom(utf8,output_utf8)
4143
importFrom(utils,packageVersion)

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# ezcox 1.0.4
22

3+
* Refined the handle of `isValidAndUnreserved()`.
34
* Enhanced the `forester()` to render labels better.
45

56
# ezcox 1.0.3

R/ezcox.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#' @importFrom stats as.formula
2626
#' @importFrom dplyr tibble
2727
#' @importFrom purrr map2_df
28+
#' @importFrom methods is
29+
#' @importFrom utf8 output_utf8
2830
#' @return a `ezcox` object
2931
#' @author Shixiang Wang <[email protected]>
3032
#' @export
@@ -176,12 +178,12 @@ ezcox <- function(data, covariates, controls = NULL,
176178
model_df <- dplyr::tibble(
177179
Variable = y,
178180
model = list(cox),
179-
status = ifelse(class(cox) == "coxph", TRUE, FALSE)
181+
status = ifelse(is(cox, "coxph"), TRUE, FALSE)
180182
)
181183
saveRDS(model_df, file = model_file)
182184
}
183185

184-
if (any(grepl("[*:|()]", controls)) & class(cox) == "coxph") {
186+
if (any(grepl("[*:|()]", controls)) & is(cox, "coxph")) {
185187
out <- as.data.frame(summary(cox)$coef)
186188
cox_sum <- summary(cox)
187189
glob.pval <- signif(cox_sum[[test]]["pvalue"], digits = 3)
@@ -206,7 +208,7 @@ ezcox <- function(data, covariates, controls = NULL,
206208
model_file = ifelse(exists("model_file"), model_file, NA_character_)
207209
)
208210
} else {
209-
if (class(cox) != "coxph" | all(is.na(tbl[["ref_level"]]))) {
211+
if (is(cox, "coxph") | all(is.na(tbl[["ref_level"]]))) {
210212
glob.pval <- p.value <- beta <- HR <- lower_95 <- upper_95 <- NA
211213
} else {
212214
cox <- summary(cox)

R/utils.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@ isValidAndUnreserved <- function(string) {
1515
split_vector <- function(x, batch_size) {
1616
split(x, ceiling(seq_along(x) / batch_size))
1717
}
18+
19+
utils::globalVariables(
20+
"estimate2"
21+
)
22+
.x = utf8::output_utf8

README.Rmd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ knitr::opts_chunk$set(
1919
[![](https://cranlogs.r-pkg.org/badges/grand-total/ezcox?color=blue)](https://cran.r-project.org/package=ezcox)
2020
[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FShixiangWang%2Fezcox&count_bg=%2379C83D&title_bg=%23555555&icon=fandom.svg&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com)
2121
![R-CMD-check](https://github.com/ShixiangWang/ezcox/workflows/R-CMD-check/badge.svg)
22-
[![Codecov test coverage](https://app.codecov.io/gh/ShixiangWang/ezcox/branch/master/graph/badge.svg)](https://app.codecov.io/gh/ShixiangWang/ezcox?branch=master)
2322
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)
2423
<!-- badges: end -->
2524

README.md

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,14 @@ status](https://www.r-pkg.org/badges/version/ezcox)](https://CRAN.R-project.org/
1010
[![](https://cranlogs.r-pkg.org/badges/grand-total/ezcox?color=blue)](https://cran.r-project.org/package=ezcox)
1111
[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FShixiangWang%2Fezcox&count_bg=%2379C83D&title_bg=%23555555&icon=fandom.svg&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com)
1212
![R-CMD-check](https://github.com/ShixiangWang/ezcox/workflows/R-CMD-check/badge.svg)
13-
[![Codecov test
14-
coverage](https://app.codecov.io/gh/ShixiangWang/ezcox/branch/master/graph/badge.svg)](https://app.codecov.io/gh/ShixiangWang/ezcox?branch=master)
1513
[![Lifecycle:
1614
stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)
1715
<!-- badges: end -->
1816

1917
The goal of ezcox is to operate a batch of univariate or multivariate
2018
Cox models and return tidy result.
2119

22-
## :arrow\_double\_down: Installation
20+
## :arrow_double_down: Installation
2321

2422
You can install the released version of ezcox from
2523
[CRAN](https://CRAN.R-project.org) with:
@@ -57,12 +55,11 @@ of cox models.
5755
library(ezcox)
5856
#> Welcome to 'ezcox' package!
5957
#> =======================================================================
60-
#> You are using ezcox version 0.8.1
58+
#> You are using ezcox version 1.0.2
6159
#>
62-
#> Github page : https://github.com/ShixiangWang/ezcox
63-
#> Documentation: https://shixiangwang.github.io/ezcox/articles/ezcox.html
64-
#>
65-
#> Run citation("ezcox") to see how to cite 'ezcox'.
60+
#> Project home : https://github.com/ShixiangWang/ezcox
61+
#> Documentation: https://shixiangwang.github.io/ezcox
62+
#> Cite as : arXiv:2110.14232
6663
#> =======================================================================
6764
#>
6865
library(survival)
@@ -82,13 +79,14 @@ ezcox(lung, covariates = c("age", "sex", "ph.ecog"))
8279
#> ==> Building Cox model...
8380
#> ==> Done.
8481
#> # A tibble: 3 × 12
85-
#> Variable is_control contrast_level ref_level n_contrast n_ref beta HR
86-
#> <chr> <lgl> <chr> <chr> <int> <int> <dbl> <dbl>
87-
#> 1 age FALSE age age 228 228 0.0187 1.02
88-
#> 2 sex FALSE sex sex 228 228 -0.531 0.588
89-
#> 3 ph.ecog FALSE ph.ecog ph.ecog 227 227 0.476 1.61
90-
#> # … with 4 more variables: lower_95 <dbl>, upper_95 <dbl>, p.value <dbl>,
91-
#> # global.pval <dbl>
82+
#> Variable is_cont…¹ contr…² ref_l…³ n_con…⁴ n_ref beta HR lower…⁵ upper…⁶
83+
#> <chr> <lgl> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl>
84+
#> 1 age FALSE age age 228 228 0.0187 1.02 1 1.04
85+
#> 2 sex FALSE sex sex 228 228 -0.531 0.588 0.424 0.816
86+
#> 3 ph.ecog FALSE ph.ecog ph.ecog 227 227 0.476 1.61 1.29 2.01
87+
#> # … with 2 more variables: p.value <dbl>, global.pval <dbl>, and abbreviated
88+
#> # variable names ¹​is_control, ²​contrast_level, ³​ref_level, ⁴​n_contrast,
89+
#> # ⁵​lower_95, ⁶​upper_95
9290

9391
# Build multi-variable models
9492
# Control variable 'age'
@@ -102,14 +100,15 @@ ezcox(lung, covariates = c("sex", "ph.ecog"), controls = "age")
102100
#> ==> Building Cox model...
103101
#> ==> Done.
104102
#> # A tibble: 4 × 12
105-
#> Variable is_control contrast_level ref_level n_contrast n_ref beta HR
106-
#> <chr> <lgl> <chr> <chr> <int> <int> <dbl> <dbl>
107-
#> 1 sex FALSE sex sex 228 228 -0.513 0.599
108-
#> 2 sex TRUE age age 228 228 0.017 1.02
109-
#> 3 ph.ecog FALSE ph.ecog ph.ecog 227 227 0.443 1.56
110-
#> 4 ph.ecog TRUE age age 228 228 0.0113 1.01
111-
#> # … with 4 more variables: lower_95 <dbl>, upper_95 <dbl>, p.value <dbl>,
112-
#> # global.pval <dbl>
103+
#> Variable is_cont…¹ contr…² ref_l…³ n_con…⁴ n_ref beta HR lower…⁵ upper…⁶
104+
#> <chr> <lgl> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl>
105+
#> 1 sex FALSE sex sex 228 228 -0.513 0.599 0.431 0.831
106+
#> 2 sex TRUE age age 228 228 0.017 1.02 0.999 1.04
107+
#> 3 ph.ecog FALSE ph.ecog ph.ecog 227 227 0.443 1.56 1.24 1.96
108+
#> 4 ph.ecog TRUE age age 228 228 0.0113 1.01 0.993 1.03
109+
#> # … with 2 more variables: p.value <dbl>, global.pval <dbl>, and abbreviated
110+
#> # variable names ¹​is_control, ²​contrast_level, ³​ref_level, ⁴​n_contrast,
111+
#> # ⁵​lower_95, ⁶​upper_95
113112
```
114113

115114
``` r
@@ -142,17 +141,17 @@ show_models(mds)
142141

143142
## :star2: Vignettes
144143

145-
- [ezcox: Easily Process a Batch of Cox
146-
Models](https://CRAN.R-project.org/package=ezcox/vignettes/ezcox.html)
147-
- [ezcox: Easily Show Cox Forestplot in One
148-
Command](https://CRAN.R-project.org/package=ezcox/vignettes/ezforest.html)
149-
- [ezcox: Easy Group Cox Analysis and
150-
Visualization](https://CRAN.R-project.org/package=ezcox/vignettes/ezgroup.html)
151-
- [ezcox: an R Package for Cox Model Batch Processing and
152-
Visualization - An Use
153-
Case](https://shixiangwang.github.io/ezcox-adv-usage/)
154-
155-
## :page\_with\_curl: Citation
144+
- [ezcox: Easily Process a Batch of Cox
145+
Models](https://CRAN.R-project.org/package=ezcox/vignettes/ezcox.html)
146+
- [ezcox: Easily Show Cox Forestplot in One
147+
Command](https://CRAN.R-project.org/package=ezcox/vignettes/ezforest.html)
148+
- [ezcox: Easy Group Cox Analysis and
149+
Visualization](https://CRAN.R-project.org/package=ezcox/vignettes/ezgroup.html)
150+
- [ezcox: an R Package for Cox Model Batch Processing and
151+
Visualization - An Use
152+
Case](https://shixiangwang.github.io/ezcox-adv-usage/)
153+
154+
## :page_with_curl: Citation
156155

157156
If you are using it in academic research, please cite the preprint
158157
[arXiv:2110.14232](https://arxiv.org/abs/2110.14232) along with URL of

0 commit comments

Comments
 (0)