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

gggcoxzph doesn't produce a plot when only 1 predictor variable #103

Closed
ziegleml opened this issue Jan 6, 2017 · 2 comments
Closed

gggcoxzph doesn't produce a plot when only 1 predictor variable #103

ziegleml opened this issue Jan 6, 2017 · 2 comments

Comments

@ziegleml
Copy link

@ziegleml ziegleml commented Jan 6, 2017

Expected behavior

I am expecting that a plot will be produced for the single predictor variable in the model.

Actual behavior

Error in x$table["GLOBAL", 3] : subscript out of bounds

Steps to reproduce the problem

This is the example with the package - works fine (also works for 2 predictors)

fit <- coxph(Surv(futime, fustat) ~ age + ecog.ps + rx, data=ovarian)
cox.zph.fit <- cox.zph(fit)
ggcoxzph(cox.zph.fit)

This is the example but with only a single predictor - age

fit <- coxph(Surv(futime, fustat) ~ age, data=ovarian)
cox.zph.fit <- cox.zph(fit)
ggcoxzph(cox.zph.fit)

Error message is returned

Error in x$table["GLOBAL", 3] : subscript out of bounds

session_info()

# please paste here the result of
Session info -----------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.3.2 (2016-10-31)
 system   x86_64, mingw32             
 ui       RStudio (1.0.44)            
 language (EN)                        
 collate  English_United States.1252  
 tz       America/New_York            
 date     2017-01-06                  

kassambara added a commit that referenced this issue Jan 7, 2017
kassambara added a commit that referenced this issue Jan 7, 2017
@kassambara
Copy link
Owner

@kassambara kassambara commented Jan 7, 2017

Thank you for reporting this issue. Bug fixed now!

@MarcinKosinski
Copy link
Contributor

@MarcinKosinski MarcinKosinski commented Jan 8, 2017

+! Thanks kassambara

@kassambara kassambara closed this Jan 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.