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

allReturns ignores subset directive #402

Closed
Panagis1980 opened this issue Aug 19, 2023 · 0 comments
Closed

allReturns ignores subset directive #402

Panagis1980 opened this issue Aug 19, 2023 · 0 comments
Assignees
Labels

Comments

@Panagis1980
Copy link

Description

allReturns ignores subset directive

Expected behavior

allReturns should calculate for given xts subset

you need to add "subset = subset" in each of the five periodReturn calls like below. it works for me:
function (x, subset = NULL, type = "arithmetic", leading = TRUE)
{
x.orig <- x
x <- try.xts(x)
all.ret <- cbind(periodReturn(x, "daily",subset = subset, type = type, leading = FALSE),
periodReturn(x, "weekly",subset = subset,type = type),
periodReturn(x, "monthly",subset = subset, type = type, indexAt = "endof"),
periodReturn(x, "quarterly", subset = subset,type = type, indexAt = "endof"),
periodReturn(x, "yearly",subset = subset, type = type))
colnames(all.ret) <- c("daily", "weekly", "monthly", "quarterly",
"yearly")
reclass(all.ret, x.orig)
}

Minimal, reproducible example

[Insert sample data and code]

Session Info

[Insert your sessionInfo() output]
@joshuaulrich joshuaulrich self-assigned this Aug 21, 2023
@joshuaulrich joshuaulrich added this to the Release 0.4.25 milestone Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants