EVOLUTION-MANAGER
Edit File: Sys.setenv.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Set or Unset Environment Variables</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for Sys.setenv {base}"><tr><td>Sys.setenv {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Set or Unset Environment Variables</h2> <h3>Description</h3> <p><code>Sys.setenv</code> sets environment variables (for other processes called from within <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> or future calls to <code><a href="Sys.getenv.html">Sys.getenv</a></code> from this <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> process). </p> <p><code>Sys.unsetenv</code> removes environment variables. </p> <h3>Usage</h3> <pre> Sys.setenv(...) Sys.unsetenv(x) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>...</code></td> <td> <p>named arguments with values coercible to a character string.</p> </td></tr> <tr valign="top"><td><code>x</code></td> <td> <p>a character vector, or an object coercible to character.</p> </td></tr> </table> <h3>Details</h3> <p>Non-standard <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> names must be quoted in <code>Sys.setenv</code>: see the examples. Most platforms (and POSIX) do not allow names containing <code>"="</code>. Windows does, but the facilities provided by <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> may not handle these correctly so they should be avoided. Most platforms allow setting an environment variable to <code>""</code>, but Windows does not, and there <code>Sys.setenv(FOO = "")</code> unsets <span class="env">FOO</span>. </p> <p>There may be system-specific limits on the maximum length of the values of individual environment variables or of all environment variables. </p> <h3>Value</h3> <p>A logical vector, with elements being true if (un)setting the corresponding variable succeeded. (For <code>Sys.unsetenv</code> this includes attempting to remove a non-existent variable.) </p> <h3>Note</h3> <p>If <code>Sys.unsetenv</code> is not supported, it will at least try to set the value of the environment variable to <code>""</code>, with a warning. </p> <h3>See Also</h3> <p><code><a href="Sys.getenv.html">Sys.getenv</a></code>, <a href="Startup.html">Startup</a> for ways to set environment variables for the <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> session. </p> <p><code><a href="getwd.html">setwd</a></code> for the working directory. </p> <p>The help for ‘<a href="EnvVar.html">environment variables</a>’ lists many of the environment variables used by <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span>. </p> <h3>Examples</h3> <pre> print(Sys.setenv(R_TEST = "testit", "A+C" = 123)) # `A+C` could also be used Sys.getenv("R_TEST") Sys.unsetenv("R_TEST") # may warn and not succeed Sys.getenv("R_TEST", unset = NA) </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>