Learn R Programming

jwutil (version 1.2.3)

bang_dollar: Get the first/only argument of the last run command

Description

This is experimental and writes to the calling frame, which, if in interactive mode, is probably the global environment. We write to a horrible and unusual (although well-known) variable name, which will avoid name conflicts.

Usage

bang_dollar()

Arguments

Value

Returns the evaluated value of the first argument to first argument of the previous R command, if it was a function call with parentheses. Primarily, the function is invoked for its side effect of adding of modifying !$ in the global environment.

References

http://kevinushey.github.io/blog/2015/02/02/rprofile-essentials/