You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering if it would be difficult to make it work when the cursor is within a function. For example, using your example, I can place the cursor after mass = mean(mass, na.rm = TRUE) and press ALT-ENTER and all the code within the chain will be executed. However, it will fail if I try to run the brakerofchains addins.
The text was updated successfully, but these errors were encountered:
PMassicotte
changed the title
Addins not working if inside a function
Addins not working if the cursor is inside a function
Jan 23, 2021
Yeah this doesn't work right now because it literally does what it says: Break chain, and run from start down. So when it sends your example to the console it's missing the closing bracket needed for summarise. To get this to work you'd need to drop your cursor down one line to include the bracket: ) %>%
It would be possible to do what you want but a little more involved. I'd have to search downward for the end of the enclosing scope and then upward for the start of the chain.
I am not sure if this behaviour would be expected or end up being kind of weird in practice. For example say you move your cursor up one line. Do you expect it to run the summarise with just height and no mass? Or do you expect it to include all columns until the end of the summarise call?
I would expect the second option. In this example, no matter if the cursor is on height or mass, everything within the summarise() would be executed. That is just an idea, no problem if you think it should not be the default behaviour.
First, thank you for this. It is really useful!
I was wondering if it would be difficult to make it work when the cursor is within a function. For example, using your example, I can place the cursor after
mass = mean(mass, na.rm = TRUE)
and press ALT-ENTER and all the code within the chain will be executed. However, it will fail if I try to run the brakerofchains addins.The text was updated successfully, but these errors were encountered: