Filtering out IPython magic %%R in formatting R code
See original GitHub issueIs there (could there be) an option to filter out the magic %%R when formatting R code? RPy2 allows Python notebooks to call R command via
%%R
library(somerpackage)
a <- some.r.function(b)
and it would be very convenient if the %%R is ignored in formatting the block, since otherwise the block fails to be formatted. Commenting %%R out -> format -> remove commenting works fine but is a little irritating to do.
Thanks and extremely appreciate this tool!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Built-in magic commands — IPython 8.7.0 documentation
IPython filters your input and converts it all into valid Python source before executing it (things like magics or aliases are turned into...
Read more >nbconvert: Remove IPython magic commands from --format ...
This is a bug, since the output is no longer a valid Python script. Indeed, even trying to run the output from the...
Read more >Jupyter And R Markdown: Notebooks With R | DataCamp
An overview of the similarities and differences between these two notebooks, with a focus on notebook sharing, code excution, version control, and project ......
Read more >How do you suppress output in Jupyter running IPython?
Add %%capture as the first line of the cell. eg %%capture print('Hello') MyFunction(). This simply discards the output, but the %%capture magic can...
Read more >Efficiently Filtering While Reading Data Into R (With Python?!)
If you have to load AND filter you should use the lesser-known readr function read_delim_chunked() (and its derivatives, read_{tsv|csv|table}_ ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ah I get it now, you are using the code formatter via the command palette or the “jupyterlab_code_formatter:styler” command right?
That shouldn’t be too hard to implement 😃
Closing due to inactivity