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
I have a subclass of data.frame, "paths". This is the hackiest part of my package and likely to change, but the tests work before and now throw an error, so I want to report this while I see it.
When my test tries to print an object that contains a "rapid::paths" object (and thus calls str()), I get an error. You can reproduce it like this:
library(S7)
df<-data.frame(a=1:2, b=1:2)
# Imagine that df belongs to an S7 subclass of data.frame.
class(df) <- c("myclass", "data.frame", "S7_object")
str(df)
#> Classes 'myclass', 'S7_object' and 'data.frame': 2 obs. of 2 variables:#> <myclass>#> Error in attributes(object) <- list(names = names(object), dim = dim(object)): dims [product 4] do not match the length of object [2]
I suspect I can avoid this by implementing a str method like I've been meaning to do anyway (not to mention that this object likely won't inherit from data.frame much longer), but it also seems like this is probably a bug.
The text was updated successfully, but these errors were encountered:
This line is causing me issues:
S7/R/class.R
Line 305 in f5b23ab
I have a subclass of data.frame, "paths". This is the hackiest part of my package and likely to change, but the tests work before and now throw an error, so I want to report this while I see it.
When my test tries to print an object that contains a "rapid::paths" object (and thus calls
str()
), I get an error. You can reproduce it like this:Created on 2024-11-12 with reprex v2.1.1
Or more directly like this:
I suspect I can avoid this by implementing a
str
method like I've been meaning to do anyway (not to mention that this object likely won't inherit from data.frame much longer), but it also seems like this is probably a bug.The text was updated successfully, but these errors were encountered: