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

saving history in non-interactive mode #2

Open
lpagie opened this issue Sep 10, 2012 · 0 comments
Open

saving history in non-interactive mode #2

lpagie opened this issue Sep 10, 2012 · 0 comments

Comments

@lpagie
Copy link

lpagie commented Sep 10, 2012

If using vtrackR in non-interactive mode saving vtags doesn't work, as it requires the function savehistory(..) to work, which only works in interactive mode. In non-interactive mode the function gethistory(..) dies with a message "Error in savehistory(file) : no history available to save". You could perhaps make this more informative by doing something like:

gethistory <- function() {
if ( ! interactive() )
stop('vtrackR requires an interactive Rsession. In BATCH mode you can force interactive mode using the commandline argument --interactive')

Return the history

Lines copied from function 'utils::history'.

By the way: isn't it a strange piece of code?

file1 <- tempfile("Rrawhist");
savehistory(file1);
rawhist <- readLines(file1);
unlink(file1);

return (rawhist);

}

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