Repository navigation
Conversation
Merged
# Conflicts: # NEWS
# Conflicts: # NEWS # tests/testthat/test-getCox.R
Closed
TuomasBorman
requested changes
Dec 4, 2026
| standardGeneric("addStability")) | ||
|
|
||
| #' @rdname getSurvival | ||
| #' @rdname getCox |
Collaborator
There was a problem hiding this comment.
This must be deprecated. There could be deprecate.R file that has these deprecated functions.
That deprecated function could have nvar as an argument as it is also now changed.
Comment on lines
+127
to
+141
| #' # The coefficients | ||
| #' op <- par(mar = c(4, 14, 1, 1)) | ||
| #' barplot(coefs, horiz = TRUE, las = 1, xlab = "Coefficient") | ||
| #' par(op) | ||
| #' | ||
| #' # Time to event of samples with risk scores above and below the median; | ||
| #' # the scores come from the data the model was fitted to, so the separation | ||
| #' # is optimistic | ||
| #' df <- data.frame(time = tse$event_time, event = tse$event, | ||
| #' risk = ifelse(tse$cox_risk_score > median(tse$cox_risk_score), | ||
| #' "high", "low")) | ||
| #' km <- survival::survfit(survival::Surv(time, event) ~ risk, data = df) | ||
| #' plot(km, col = c("red", "blue"), xlab = "Time", ylab = "Without event") | ||
| #' legend("bottomleft", legend = c("high risk", "low risk"), | ||
| #' col = c("red", "blue"), lty = 1) |
Collaborator
There was a problem hiding this comment.
For these, there could be simple plotting function that return ggplot object.
E.g., getCox() could return specific class (e.g., "miatime_cox"), then generic plot() function could be utilized.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows the review on #112: getSurvival() and addSurvival() are now getCox() and addCox(), nvar is max.features, and the examples summarise and plot the results. Closes #93.