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

data manipulation in vscode-r #445

Closed
LeoUtas opened this issue Nov 12, 2020 · 8 comments
Closed

data manipulation in vscode-r #445

LeoUtas opened this issue Nov 12, 2020 · 8 comments

Comments

@LeoUtas
Copy link

LeoUtas commented Nov 12, 2020

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
I handle data a lot with R. In R studio, it's easy to use $ to access some layers of a data frame but it doesn't work yet in vscode.
Thanks for your great work
Hoang

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@renkun-ken
Copy link
Member

renkun-ken commented Nov 12, 2020

If you enabled R session watcher, then you should be able to complete the first level of names of any object, just like introduced at my blog post about the session symbol completion.

@LeoUtas
Copy link
Author

LeoUtas commented Nov 12, 2020

G' day there

Perhaps, I didn't express it clearly. I wanted to mention the suggestion or autocompletion when working with data. E.g. a data frame usually contains a bunch of columns, it'd be great to have the suggestions/autocompletion of a column to use with just a simple $ sign or something.
Another important thing with data handling is to view list. If a dataset is in a format of a nested list. It'd great to have a way to view the list to see its structure (such as view() in R studio). It's necessary to view when it comes to set some loops for the nested list of data.

Another thing is I can't handle python anymore. I tried to open a python file and execute it but the terminal is set to R automatically then it doesn't realize the python code. Did I miss something

Thanks a bunch for your beautiful work
H

@renkun-ken
Copy link
Member

I wanted to mention the suggestion or autocompletion when working with data. E.g. a data frame usually contains a bunch of columns, it'd be great to have the suggestions/autocompletion of a column to use with just a simple $ sign or something.

The session watcher supports session symbol completion (#165), i.e. $, @ and [ to trigger auto-completion of session symbols of list, data.frame and S4 objects. If you properly enabled this feature, it should work out of the box.

Another important thing with data handling is to view list. If a dataset is in a format of a nested list. It'd great to have a way to view the list to see its structure (such as view() in R studio). It's necessary to view when it comes to set some loops for the nested list of data.

We don't have the RStudio-like viewer of nested list at the moment. The session watcher currently only supports a naive list viewer implemented in #150.

Another thing is I can't handle python anymore. I tried to open a python file and execute it but the terminal is set to R automatically then it doesn't realize the python code. Did I miss something

You need to install Python extension to work with python scripts and optionally Pylance and a better language server for Python. Please visit https://code.visualstudio.com/docs/python/python-tutorial for more details.

@jooyoungseo
Copy link
Contributor

In my case, auto-completion does not work for data.frame even though "r.sessionWatcher" is enabled. For example, I typed airquality$ in VSCode editor, but it does not suggest any related columns, such as Ozone, Month, etc.

@renkun-ken
Copy link
Member

Currently, the completion provided by session watcher is only capable of providing completions from global environment, i.e. variables created by user in globalenv, rather than symbols defined in packages (in this case, airquality comes from {datasets}).

If we implement #440 and use R's built-in completion in editor, we could provide completions like in RStudio but it will suffer from the same problem using such completion too.

@LeoUtas
Copy link
Author

LeoUtas commented Nov 29, 2020

@renkun-ken You know what you guys are doing great I love your work. It greatly helps me to make my code tidy and neat using format document in vscode. Perhaps, we are just too familiar with Rstudio for such a long time then we find the auto completion in data handling and some other features e.g. we can run all the codes inside {} with just ctrl + Enter.
I sometimes need to use Rstudio for quickly testing some chunks of codes and parallelly open my work in vs code

@github-actions
Copy link

This issue is stale because it has been open for 365 days with no activity.

@github-actions github-actions bot added the stale label May 26, 2022
@github-actions
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants