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

Method as.matrix #37

Open
david-cortes opened this issue Jan 10, 2021 · 1 comment
Open

Method as.matrix #37

david-cortes opened this issue Jan 10, 2021 · 1 comment

Comments

@david-cortes
Copy link
Contributor

The method as.matrix will convert a float32 vector into a float32 matrix.

However, as.matrix as used in other packages is meant to return a matrix object, which allows creating libraries that accept arbitrary objects from other packages without having to add them as dependencies - that is, one can create a library with a function that takes an input X, call as.matrix on it, and then pass it to a function that expects a matrix object, with the X potentially being a data.table, dgCMatrix, etc. (without adding dependencies on data.table or Matrix).

Would be nice if this package could follow this logic too, perhaps adding a different function as.float_matrix or the like that would do what as.matrix.float32 currently does.

@wrathematics
Copy link
Owner

You make a good point. I think it makes sense to change it as you suggest. I will try to get to it in the next few days, but PR's welcome.

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