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

center() fails when .data doesn't have rownames #5

Closed
mikemc opened this issue Aug 6, 2019 · 1 comment
Closed

center() fails when .data doesn't have rownames #5

mikemc opened this issue Aug 6, 2019 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@mikemc
Copy link
Owner

mikemc commented Aug 6, 2019

I think center() should be able to handle this case; rows correspond to samples and there is no need for the samples to have names for computing the center to make sense. Note, the function works fine w/o column names if enframe is not used.

Z <- matrix(c(
        NaN, 1, 3.5, 
        -1, NaN, 4,
        -2, 3, NaN,
        -1, 2, 3), ncol = 3, byrow = T)
# colnames(Z) <- paste0("T", 1:3)
# rownames(Z) <- paste0("S", 1:4)
metacal::center(Z, in_scale = "log")
#> Object passed to `as_tibble()` must have row names if the `rownames`
#> argument is set.

Created on 2019-08-06 by the reprex package (v0.3.0)

@mikemc mikemc added the bug Something isn't working label Aug 6, 2019
@mikemc mikemc self-assigned this Aug 6, 2019
@mikemc
Copy link
Owner Author

mikemc commented Aug 6, 2019

The problem is arising within coocurrence_matrix(). In particular, the call to tibble::as_tibble(mat, rownames = "Sample").

@mikemc mikemc closed this as completed in 4e207a8 Aug 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant