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
In my quest to replace Rstudio, I found this extension. After some troubled start (even opened a "bug request that was totally my fault), I'm linking it a lot. I can preview dataframes, have a session explorer and even show plots and help in separated tabs.
There is only one feature that I'm missing a lot and makes a huge difference in my workflow. dplyr has become a standard for data munging with R. It's clean, is part of tidyverse, has a standardized syntax, etc, etc. When using Rstudio, whenever you start with a dataframe and then use the pipe (%>%) operator, all the dataframes variables became available as suggestions for autocompletion:
Even works after the first pipe:
This is a huge time saver for me, because I normally work with dataframes that have 100+ variables whose variable names consists of abbreviations of words, theoretical example "loa_tot_prc" (loan total price).
Unfortunately, the same doesn't happen with the current state of Vscode, at least from what I searched:
(here I created the my_df object outside the script file otherwise IntelliSense will suggest variable names just because it found them earlier in the code).
My workaround now is to call an names(my_df) and then manually search the variable names that exists.
Because the logic behind this is "kinda" straightforward:
Check for pipe operator;
Call names() for the dataframe prior to the pipe;
Use the result of the names() call as suggestions.
What do you guys think? It's hard, not so much? Maybe if pointed to the right direction I could try by myself. I need help/instructions in this regard.
The text was updated successfully, but these errors were encountered:
Hmm, for me this works already?
To be fair, var1, var2, var3 were at the bottom of the list, so I had to hit up-arrow.
Interestingly, when I repeated your example exactly, in other words having the df defined in the terminal and not the script window, it does't work anymore...
IntelliSense sometimes suggest variable names simply because they are present elsewhere in the script file. If you load a dataset from a file or from a database, it won't work that way. Check my previous post:
(here I created the my_df object outside the script file otherwise IntelliSense will suggest variable names just because it found them earlier in the code).
I'm willing to give this implementation a try, but I would need some help, specially in the beginning.
In my quest to replace Rstudio, I found this extension. After some troubled start (even opened a "bug request that was totally my fault), I'm linking it a lot. I can preview dataframes, have a session explorer and even show plots and help in separated tabs.
There is only one feature that I'm missing a lot and makes a huge difference in my workflow.
dplyr
has become a standard for data munging with R. It's clean, is part of tidyverse, has a standardized syntax, etc, etc. When using Rstudio, whenever you start with a dataframe and then use the pipe (%>%
) operator, all the dataframes variables became available as suggestions for autocompletion:Even works after the first pipe:
This is a huge time saver for me, because I normally work with dataframes that have 100+ variables whose variable names consists of abbreviations of words, theoretical example "loa_tot_prc" (loan total price).
Unfortunately, the same doesn't happen with the current state of Vscode, at least from what I searched:
(here I created the
my_df
object outside the script file otherwise IntelliSense will suggest variable names just because it found them earlier in the code).My workaround now is to call an
names(my_df)
and then manually search the variable names that exists.Because the logic behind this is "kinda" straightforward:
names()
for the dataframe prior to the pipe;names()
call as suggestions.I could try and implement it by myself, but I have -10 experience developing extensions to Vscode, or with Vscode in general. I was reading about how this could be done (https://code.visualstudio.com/api/language-extensions/programmatic-language-features) and it seems doable, at least in theory.
What do you guys think? It's hard, not so much? Maybe if pointed to the right direction I could try by myself. I need help/instructions in this regard.
The text was updated successfully, but these errors were encountered: