Skip to content

saving history in non-interactive mode #2

@lpagie

Description

@lpagie

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);

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions