Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow Inf and near 0 CIs to plot in ggforest #582

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rschauner
Copy link

Meant to fix my issue (#570). During axis ticks generation, if there are any near 0 or Inf values, they are set to the min and max values across all confidence intervals.

Things I thought would be nice but didn't know how to include.

  • Some way to know where the estimate is if it is outside the plot range.
  • Arrows to know the CI continues outside the plot area.

I was planning on just adding that in Adobe Illustrator, but, that might be something that could be done by ggplot2.

Apologies about all the changes, my linter in Visual Studio Code seemed to take over

conf.high <- conf.low <- estimate <- NULL
stopifnot(inherits(model, "coxph"))

# get data and variables/terms from cox model
data <- .get_data(model, data = data)
data <- survminer:::.get_data(model, data = data)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

survminer::: should be removed

var <- names(terms)[i]
#### ADD with = FALSE because error during testing
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be a data.table version thing, data.table version is 1.14.0

toShowExpClean <- toShowExpClean[nrow(toShowExpClean):1, ]

# get min/max CI values to place where Inf would be
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get min/max CI values and replace near 0 and Inf values with those

@rschauner rschauner mentioned this pull request Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant