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

plot.cvrisk x-axis tick labels #102

Closed
Almond-S opened this issue May 22, 2019 · 1 comment
Closed

plot.cvrisk x-axis tick labels #102

Almond-S opened this issue May 22, 2019 · 1 comment

Comments

@Almond-S
Copy link

The x-axis ticks are not labeled correctly as the attributes of the cvrisk-object x are dropped

here:

x <- x[, apply(x, 2, function(y) all(!is.na(y))), drop = FALSE]

as one can see for instance in this example:

library(mboost)
data <- data.frame( y = rep(0:1, each = 6),
                    x = rep(0:1, 6))
model <- mboost(y ~ bols(x), data = data, control = boost_control(mstop = 5) )
cross <- cvrisk(model, grid = 0:5)
plot(cross)

To fix it, one would only have to store
mstops <- attr(x, "mstop") in advance and replace it bellow in

axis(1, at = 1:ncol(x), labels = attr(x, "mstop"))

@thothorn
Copy link
Collaborator

thothorn commented Dec 2, 2020

Thanks, fixed in 2.9-3

@thothorn thothorn closed this as completed Dec 2, 2020
thothorn pushed a commit that referenced this issue Dec 2, 2020
thothorn pushed a commit that referenced this issue Dec 2, 2020
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

No branches or pull requests

2 participants