-
Notifications
You must be signed in to change notification settings - Fork 21
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
bug in recycleSingleBracketReplacementValue
?
#34
Comments
I'm inclined to declare that this is unsupported. It's true that data.frame supports this by wrapping the vector up into a matrix and essentially converting that to a data.frame. However, that is complex behavior and generally has undesirable properties (in your case, the "numbers" column becomes character). It would be much better to create a list with |
Hi Michael, |
Seems like a different case to me. The way I think about it (and how it's implemented) is that the RHS is coerced to a DataFrame. A matrix has an obvious coercion to a DataFrame, but the behavior for an atomic vector would be different. |
Actually, it's also broken when the right value is a matrix:
|
That's expected given the simple rule of coercing to a DataFrame. It's only surprising because what happens when subassigning a factor into an integer vector is surprising. To stick to the principle of mimicking the behavior of data.frame here, I could set |
It seems to me that coercion from character matrix to DataFrame should be fixed in general, not just in the context of coercing the RHS to DataFrame. Other coercions from character-based object to DataFrame have broke free long ago from the non-sense factor thing. Once Hope that makes sense. Thanks! |
I guess we can go that way, arguing for consistency with the other coercions. There's nothing wrong with matrix RHS per se; there's just the general issues with character to factor coercion. The term "straight-forward" is a relative. This stuff is pretty tricky; every change seems to have a domino effect. Check the previous commit to see a solution I drafted up; it was not as clean as I had hoped. |
Hi Michael,
I was testing on the
DataFrame
after refactoring ofS4Vectors
with new internal functions, and I got this warning / error for replacement value:row replacement with single value works!
The text was updated successfully, but these errors were encountered: