Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ps_environ

Environment variables of a process


Description

ps_environ() returns the environment variables of the process, in a named vector, similarly to the return value of Sys.getenv() (without arguments).

Usage

ps_environ(p = ps_handle())

ps_environ_raw(p = ps_handle())

Arguments

p

Process handle.

Details

Note: this usually does not reflect changes made after the process started.

ps_environ_raw() is similar to p$environ() but returns the unparsed "var=value" strings. This is faster, and sometimes good enough.

These functions throw a zombie_process error for zombie processes.

Value

ps_environ() returns a named character vector (that has a Dlist class, so it is printed nicely), ps_environ_raw() returns a character vector.

See Also

Examples

p <- ps_handle()
p
env <- ps_environ(p)
env[["R_HOME"]]

ps

List, Query, Manipulate System Processes

v1.6.0
MIT + file LICENSE
Authors
Jay Loden [aut], Dave Daeschler [aut], Giampaolo Rodola' [aut], Gábor Csárdi [aut, cre], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.