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

shift + enter/return Twice or More Doesn't Parse Correctly #62

Open
nigeljmckernan opened this issue Mar 16, 2021 · 0 comments
Open

shift + enter/return Twice or More Doesn't Parse Correctly #62

nigeljmckernan opened this issue Mar 16, 2021 · 0 comments

Comments

@nigeljmckernan
Copy link

First off, this is a great package; I've been doing some playing around with this package and I'm surprised at how simple it is to use and set up. I thought it would involve much more complex networking stuff to actually make work.

This is not a major issue, more of an issue of readability for anyone who heavily relies on the %>% pipe operator from magrittr.

When running some standard pipeline-esque dplyr/magrittr code, it only parses the entire pipeline correctly if I only use shift + enter once, or not at all.

I'll demonstrate with a minimal reprex:

remoter> library(dplyr)

remoter> nycflights13::flights %>%
remoter+     filter(month == 1) %>%
remoter+     group_by(tailnum) %>%
remoter+     summarise(Max_Dep_Delay = max(dep_delay, na.rm = TRUE))
## A tibble: 3,149 x 2
#   tailnum Max_Dep_Delay
#   <chr>           <dbl>
# 1 N0EGMQ             54
# 2 N10156            126
# 3 N102UW             -7
# 4 N103US             -1
# 5 N104UW             29
# 6 N10575            184
# 7 N107US             -3
# 8 N108UW             -7
# 9 N109UW             -5
#10 N110UW            -10
## ... with 3,139 more rows 

However, when doing shift + enter more than once, remoter doesn't seem to like empty lines, even though this works perfectly fine in a regular R console:

remoter> nycflights13::flights %>%
remoter+     
remoter>     filter(month == 1) %>%
remoter+     
Error: object 'month' not found
remoter>     group_by(tailnum) %>%
remoter+     
Error: object 'tailnum' not found
remoter>     summarise(Max_Dep_Delay = max(dep_delay, na.rm = TRUE))
Error: object 'dep_delay' not found

I can get around that by inserting a # in the blank lines, though it's a bit annoying.

remoter> nycflights13::flights %>%
remoter+     #
remoter+     filter(month == 1) %>%
remoter+     #
remoter+     group_by(tailnum) %>%
remoter+     #
remoter+     summarise(Max_Dep_Delay = max(dep_delay, na.rm = TRUE))
# A tibble: 3,149 x 2
#   tailnum Max_Dep_Delay
#   <chr>           <dbl>
# 1 N0EGMQ             54
# 2 N10156            126
# 3 N102UW             -7
# 4 N103US             -1
# 5 N104UW             29
# 6 N10575            184
# 7 N107US             -3
# 8 N108UW             -7
# 9 N109UW             -5
#10 N110UW            -10
## ... with 3,139 more rows 

Is there a way for remoter to account for empty lines in some string of code just to make it a bit more readable in situations like these?

Regardless, thanks for the package; using the unbelievably laggy Remote Desktop to my work machine might finally have its end in sight!

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

1 participant