You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a survfit object is created with estimate_KM() additional information is added to the output object. But we still return the object as class 'survift'. The consequences of this is that users could create survfit objects with survival::survfit(); they could pass this object to any visR S3 method for survfit objects, but there is a good chance there is an error.
I suggest one of the following:
Add the class c("visr_survfit", "survfit") to objects created with estimate_KM() and updated all S3 methods from get_pvalue.survfit() to get_pvalue.visr_survfit(), for example. This solution is the most in-line with how most users would expect a function to work, I think.
Write a simple internal function that checks if the survift object was created with visR and print a warning if it was not. Example below
When a survfit object is created with
estimate_KM()
additional information is added to the output object. But we still return the object as class'survift'
. The consequences of this is that users could create survfit objects withsurvival::survfit()
; they could pass this object to any visR S3 method for survfit objects, but there is a good chance there is an error.I suggest one of the following:
c("visr_survfit", "survfit")
to objects created withestimate_KM()
and updated all S3 methods fromget_pvalue.survfit()
toget_pvalue.visr_survfit()
, for example. This solution is the most in-line with how most users would expect a function to work, I think.Created on 2022-05-08 by the reprex package (v2.0.1)
I don't think this is a priority and can wait until after the next CRAN release.
The text was updated successfully, but these errors were encountered: