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

Question: savehistory built-in R function does not seem to work for IR console -- is this inevitable/to be expected? #676

Open
krinsman opened this issue Feb 19, 2021 · 0 comments

Comments

@krinsman
Copy link

To clarify, saying "IR console", I mean the result of pressing the "R" button underneath "Console" in the Jupyter Lab launcher interface. I would attach a screenshot of that interface to be entirely unambiguous, but that seems to not be supported anymore in GitHub issues?

Silly MWE:

R version 4.0.3 (2020-10-10)

[1]: 4+4
     8

[2]: 29-2
     27

[3]: 8**2
     64

[4]: savehistory("test.txt")
    Error in .External2(C_savehistory, file): no history available to save
    Traceback:
    
    1. savehistory("test.txt")

Basically what I was hoping for when trying to use savehistory was an R language/IR kernel equivalent of the IPython %notebook magic which has proven useful for me when working in Python.

This question seems similar to another issue about saving the notebook to HTML and another question which seems to be referring to the command line version of the IR console, but I'm not sure whether that issue refers to history of a single session (all I'm interested in here, like if kernel is shut down, flush the history, fine by me) or to the input history from all sessions from all time (e.g. like a log file), which is what it sounds like to me based on this comment.

Anyway just wanted to know whether I should work only in R notebooks in case the session turns out to be useful and I want to save its output for later, or if there's a hidden trick like the %notebook (or I guess using savehistory from the command line -- I've almost always used R via IRkernel so have little understanding of how "raw R" works, to be honest).

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