question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Filtering out IPython magic %%R in formatting R code

See original GitHub issue

Is 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ryantam626commented, Apr 20, 2020

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 😃

0reactions
ryantam626commented, May 17, 2020

Closing due to inactivity

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found