Skip to content

lastcommand #3

@Dasonk

Description

@Dasonk
lastcmd <- function(){
    tmp <- tempfile()
    savehistory(tmp)

    # If we call this function then that call will
    # be the last line in the history so we want the one
    # before that
    tail(readLines(tmp), 2)[1]
}

http://stackoverflow.com/questions/18972845/get-last-top-level-command-as-a-character-string

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