Closed bkmontgom closed 5 years ago
I can reproduce this error, but I think the issue is specifically with the compound assignment pipe, not inset
. At least substituting x <- inset(x, y == 'a', x[y == 'b'])
works fine for me (and I would be surprised if it didn't since it is literally a direct alias if you look at the code).
Here is what I got with x <- inset(x, y == 'a', x[y == 'b'])
and no compound assignment pipe.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 Error in inset(x, y == "a", x[y == "b"]) :
incompatible types (from builtin to integer) in subassignment type fix
The next two times R crashed after 50, then 26 times through the loop. I see that the code is a direct alias, so I can't explain this behavior.
Just to be sure, I tried x <- `[<-`(x, y == 'a', x[y == 'b'])
and it crashed as well.
Since this code doesn't involve anything from magrittr, I tried removing library('magrittr')
and I still got failures.
I'll have to contact the base R folks. Thank you for your help.
Trying this again...I'm still having problems with it. #160 was closed because the error could not be reproduced.
If you can't reproduce this error, please try increasing the length of x. The larger I make it, the more likely it is to crash R, instead of giving an error first. The error I usually get is
If the commented-out code is substituted, this works without error or crash.