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

Cl() fails on multiple calls w/ attribute based subsetting #429

Open
ethanbsmith opened this issue Dec 23, 2024 · 0 comments
Open

Cl() fails on multiple calls w/ attribute based subsetting #429

ethanbsmith opened this issue Dec 23, 2024 · 0 comments

Comments

@ethanbsmith
Copy link
Contributor

Description

[Describe the issue]

Expected behavior

the attribute base 'getter" functions only work on the original structure on which they were set. if subsequent calls are made to already subset data, they will fail. This is an edge case, but might be worth removing the attribute on the output value

Minimal, reproducible example

data(sample_matrix, package = "xts")
d <- as.xts(sample_matrix)

Cl(Cl(d)) #works fine

attr(d,"Cl") <- 4
> Cl(Cl(d))
Error in `[.xts`(x, , loc) : subscript out of bounds

Session Info

quantmod_0.4.26.1
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

1 participant