<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>7. Altering oce Defaults • oce</title>
<script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="../deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet">
<script src="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href="../deps/font-awesome-6.4.2/css/all.min.css" rel="stylesheet">
<link href="../deps/font-awesome-6.4.2/css/v4-shims.min.css" rel="stylesheet">
<script src="../deps/headroom-0.11.0/headroom.min.js"></script><script src="../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src="../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src="../deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src="../deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src="../deps/search-1.0.0/fuse.min.js"></script><script src="../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="7. Altering oce Defaults">
</head>
<body>
    <a href="#main" class="visually-hidden-focusable">Skip to contents</a>


    <nav class="navbar navbar-expand-lg fixed-top bg-light" data-bs-theme="light" aria-label="Site navigation"><div class="container">

    <a class="navbar-brand me-2" href="../index.html">oce</a>

    <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8-4</small>


    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>

    <div id="navbar" class="collapse navbar-collapse ms-3">
      <ul class="navbar-nav me-auto">
<li class="nav-item"><a class="nav-link" href="../reference/index.html">Reference</a></li>
<li class="active nav-item dropdown">
  <button class="nav-link dropdown-toggle" type="button" id="dropdown-articles" data-bs-toggle="dropdown" aria-expanded="false" aria-haspopup="true">Articles</button>
  <ul class="dropdown-menu" aria-labelledby="dropdown-articles">
<li><a class="dropdown-item" href="../articles/A_oce.html">1. Introduction to Oce</a></li>
    <li><a class="dropdown-item" href="../articles/B_ctd.html">2. Analysis of CTD data</a></li>
    <li><a class="dropdown-item" href="../articles/C_adp.html">3. Analysis of acoustic-Doppler data</a></li>
    <li><a class="dropdown-item" href="../articles/D_map_projections.html">4. Using map projections</a></li>
    <li><a class="dropdown-item" href="../articles/E_flags.html">5. Dealing with data-quality flags</a></li>
    <li><a class="dropdown-item" href="../articles/F_subclassing.html">6. Subclassing oce objects</a></li>
    <li><a class="dropdown-item" href="../articles/G_altering_defaults.html">7. Altering oce Defaults</a></li>
    <li><a class="dropdown-item" href="../articles/H_tides.html">8. Tidal Analysis</a></li>
  </ul>
</li>
<li class="nav-item"><a class="nav-link" href="../news/index.html">Changelog</a></li>
      </ul>
<ul class="navbar-nav">
<li class="nav-item"><form class="form-inline" role="search">
 <input class="form-control" type="search" name="search-input" id="search-input" autocomplete="off" aria-label="Search site" placeholder="Search for" data-search-index="../search.json">
</form></li>
<li class="nav-item"><a class="external-link nav-link" href="https://github.com/dankelley/oce/" aria-label="GitHub"><span class="fa fab fa-github fa-lg"></span></a></li>
      </ul>
</div>


  </div>
</nav><div class="container template-article">




<div class="row">
  <main id="main" class="col-md-9"><div class="page-header">

      <h1>7. Altering oce Defaults</h1>
                        <h4 data-toc-skip class="author">Dan Kelley (<a href="https://orcid.org/0000-0001-7808-5911" class="external-link uri">https://orcid.org/0000-0001-7808-5911</a>)</h4>
            
            <h4 data-toc-skip class="date">2024-09-24</h4>
      
      <small class="dont-index">Source: <a href="https://github.com/dankelley/oce/blob/HEAD/vignettes/G_altering_defaults.Rmd" class="external-link"><code>vignettes/G_altering_defaults.Rmd</code></a></small>
      <div class="d-none name"><code>G_altering_defaults.Rmd</code></div>
    </div>

    
    
<p><strong>Abstract.</strong> When R loads the <code>oce</code> package,
certain defaults are defined for values such as the chosen equation of
state, the expected timezone, etc. This vignette lists those defaults
and explains how (with caution) they may be altered with the
<code>~/.Rprofile</code> file.</p>
<p>The table below shows the default values of some quantities that
<code>oce</code> uses in its processing. In most cases, these values
make their way into the package as default values of function parameters
via calls to the <code><a href="https://rdrr.io/r/base/options.html" class="external-link">getOption()</a></code> function. See
<code><a href="../reference/plotTS.html">?plotTS</a></code> for an example.</p>
<p>Note that any of these values may be altered in the user’s
<code>~/.Rprofile</code> file. For example, a user preferring that the
old UNESCO equation of state be used in operations like plotting CTD
data, might insert the following line in the <code>~/.Rprofile</code>
file:</p>
<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">options</a></span><span class="op">(</span>oceEOS <span class="op">=</span> <span class="st">"gsw"</span><span class="op">)</span></span></code></pre></div>
<p><em>but</em> it should be noted that setting values in
<code>~/.Rprofile</code> will render the user’s code non-reproducible
(unless that file is provided along with the analysis code).</p>
<p>The preferred method is not to use <code>~/.Rprofile</code>, but
instead to specify the desired properties as arguments to relevant
functions. For example, calling <code>plotTS(..., eos="unesco")</code>
instead of letting <code>eos</code> take on the default value of
<code>"gsw"</code>. (It is the ability to specify a choice by such a
parameter that is indicated in the right-most column of the following
table.)</p>
<table class="table">
<colgroup>
<col width="30%">
<col width="28%">
<col width="41%">
</colgroup>
<thead><tr class="header">
<th>Name</th>
<th>Value</th>
<th>Selected by a function parameter</th>
</tr></thead>
<tbody>
<tr class="odd">
<td><code>oceAbbreviateTimeRange</code></td>
<td><code>TRUE</code></td>
<td>yes</td>
</tr>
<tr class="even">
<td><code>oceDebug</code></td>
<td><code>0</code></td>
<td>yes</td>
</tr>
<tr class="odd">
<td><code>oceDrawTimeRange</code></td>
<td><code>TRUE</code></td>
<td>yes</td>
</tr>
<tr class="even">
<td><code>oceEOS</code></td>
<td><code>"gsw"</code></td>
<td>yes</td>
</tr>
<tr class="odd">
<td><code>oceMar</code></td>
<td><code>c(3, 3, 2, 2)</code></td>
<td>yes</td>
</tr>
<tr class="even">
<td><code>oceMgp</code></td>
<td><code>c(2.0, 0.7, 0)</code></td>
<td>yes</td>
</tr>
<tr class="odd">
<td><code>oceTimeFormat</code></td>
<td><code>"%Y-%m-%d %H:%M:%S"</code></td>
<td>yes</td>
</tr>
<tr class="even">
<td><code>oceTz</code></td>
<td><code>"UTC"</code></td>
<td>yes</td>
</tr>
<tr class="odd">
<td><code>oceUnitBracket</code></td>
<td><code>"["</code></td>
<td>no</td>
</tr>
<tr class="even">
<td><code>webtide</code></td>
<td><code>"/usr/local/WebTide"</code></td>
<td>yes</td>
</tr>
</tbody>
</table></main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
    </nav></aside>
</div>



    <footer><div class="pkgdown-footer-left">
  <p>Developed by Dan Kelley, Clark Richards.</p>
</div>

<div class="pkgdown-footer-right">
  <p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.1.0.9000.</p>
</div>

    </footer>
</div>





  </body>
</html>
