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

rownames, colnames lost after applying roll_* function #17

Open
mahl opened this issue Aug 12, 2016 · 2 comments
Open

rownames, colnames lost after applying roll_* function #17

mahl opened this issue Aug 12, 2016 · 2 comments

Comments

@mahl
Copy link

mahl commented Aug 12, 2016

rownames, colnames lost after applying roll_* function on matrix.

@kevinushey
Copy link
Owner

Thanks; I'll take a look at this.

@kevinushey
Copy link
Owner

Column names are now preserved, but I'm not sure what the right way to propagate row names here is exactly. For example:

library(RcppRoll)
m <- matrix(1:16, nrow = 4)
rownames(m) <- letters[1:4]
colnames(m) <- LETTERS[1:4]
m
#>   A B  C  D
#> a 1 5  9 13
#> b 2 6 10 14
#> c 3 7 11 15
#> d 4 8 12 16
roll_mean(m, 3)
#>      A B  C  D
#> [1,] 2 6 10 14
#> [2,] 3 7 11 15

What row names should be applied in this case? Do we carry forward the first row names ('a' and 'b')? Does it depend on alignment / fill?

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

2 participants