<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
  <head>
  <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Space normalize trajectories. — mt_space_normalize • mousetrap</title>


<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<!-- Bootstrap -->

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous" />

<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script>

<!-- bootstrap-toc -->
<link rel="stylesheet" href="../bootstrap-toc.css">
<script src="../bootstrap-toc.js"></script>

<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous" />

<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script>

<!-- headroom.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script>

<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script>




<meta property="og:title" content="Space normalize trajectories. — mt_space_normalize" />
<meta property="og:description" content="Adjust trajectories so that all trajectories have an identical start and end 
point. If no end points are provided, trajectories are only adjusted so that 
they have the same start position. Please note that this function is 
deprecated and that mt_align_start_end should be used
instead, which provides the same (and additional) functionality." />




<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>

<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->



  </head>

  <body data-spy="scroll" data-target="#toc">
    <div class="container template-reference-topic">
      <header>
      <div class="navbar navbar-default navbar-fixed-top" role="navigation">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <span class="navbar-brand">
        <a class="navbar-link" href="../index.html">mousetrap</a>
        <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">3.2.0</span>
      </span>
    </div>

    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav">
        <li>
  <a href="../reference/mousetrap.html">Overview</a>
</li>
<li>
  <a href="../reference/index.html">Reference</a>
</li>
<li>
  <a href="../news/index.html">News</a>
</li>
      </ul>
      <ul class="nav navbar-nav navbar-right">
        <li>
  <a href="https://github.com/pascalkieslich/mousetrap">
    <span class="fas fa-github fa-lg"></span>
     
  </a>
</li>
      </ul>
      
    </div><!--/.nav-collapse -->
  </div><!--/.container -->
</div><!--/.navbar -->

      

      </header>

<div class="row">
  <div class="col-md-9 contents">
    <div class="page-header">
    <h1>Space normalize trajectories.</h1>
    <small class="dont-index">Source: <a href='https://github.com/pascalkieslich/mousetrap/blob/master/R/preprocess.R'><code>R/preprocess.R</code></a></small>
    <div class="hidden name"><code>mt_space_normalize.Rd</code></div>
    </div>

    <div class="ref-description">
    <p>Adjust trajectories so that all trajectories have an identical start and end 
point. If no end points are provided, trajectories are only adjusted so that 
they have the same start position. Please note that this function is 
<strong>deprecated</strong> and that <a href='mt_align_start_end.html'>mt_align_start_end</a> should be used
instead, which provides the same (and additional) functionality.</p>
    </div>

    <pre class="usage"><span class='fu'>mt_space_normalize</span><span class='op'>(</span>
  <span class='va'>data</span>,
  use <span class='op'>=</span> <span class='st'>"trajectories"</span>,
  save_as <span class='op'>=</span> <span class='st'>"sn_trajectories"</span>,
  dimensions <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"xpos"</span>, <span class='st'>"ypos"</span><span class='op'>)</span>,
  start <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fl'>0</span>, <span class='fl'>0</span><span class='op'>)</span>,
  end <span class='op'>=</span> <span class='cn'>NULL</span>,
  verbose <span class='op'>=</span> <span class='cn'>FALSE</span>
<span class='op'>)</span></pre>

    <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
    <table class="ref-arguments">
    <colgroup><col class="name" /><col class="desc" /></colgroup>
    <tr>
      <th>data</th>
      <td><p>a mousetrap data object created using one of the mt_import
functions (see <a href='mt_example.html'>mt_example</a> for details). Alternatively, a trajectory
array can be provided directly (in this case <code>use</code> will be ignored).</p></td>
    </tr>
    <tr>
      <th>use</th>
      <td><p>a character string specifying which trajectory data should be
used.</p></td>
    </tr>
    <tr>
      <th>save_as</th>
      <td><p>a character string specifying where the resulting trajectory
data should be stored.</p></td>
    </tr>
    <tr>
      <th>dimensions</th>
      <td><p>a character vector specifying the dimensions in the
trajectory array that should be space-normalized.</p></td>
    </tr>
    <tr>
      <th>start</th>
      <td><p>a numeric vector specifying the start values for each dimension,
i.e., the values the first recorded position should have in every trial.</p></td>
    </tr>
    <tr>
      <th>end</th>
      <td><p>a numeric vector specifying the end values for each dimension,
i.e., the values the last recorded position should have in every trial. If
<code>NULL</code>, trajectories are only adjusted so that they have the same
start position.</p></td>
    </tr>
    <tr>
      <th>verbose</th>
      <td><p>logical indicating whether function should report its
progress.</p></td>
    </tr>
    </table>

    <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>

    <p>A mousetrap data object (see <a href='mt_example.html'>mt_example</a>) with an additional
  array (by default called <code>sn_trajectories</code>) containing the
  space-normalized trajectories. All other trajectory dimensions not
  specified in <code>dimensions</code> (e.g., timestamps) will be kept as is in the
  resulting trajectory array. If a trajectory array was provided directly as
  <code>data</code>, only the space-normalized trajectories will be returned.</p>
    <h2 class="hasAnchor" id="references"><a class="anchor" href="#references"></a>References</h2>

    <p>Dale, R., Kehoe, C., &amp; Spivey, M. J. (2007). Graded motor
  responses in the time course of categorizing atypical exemplars.
  <em>Memory &amp; Cognition, 35</em>(1), 15-28.</p>
    <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>

    <div class='dont-index'><p><a href='mt_align_start.html'>mt_align_start</a> for aligning the start position of
  trajectories.</p>
<p><a href='mt_remap_symmetric.html'>mt_remap_symmetric</a> for remapping trajectories.</p></div>
    <h2 class="hasAnchor" id="author"><a class="anchor" href="#author"></a>Author</h2>

    <p>Pascal J. Kieslich</p>
<p>Felix Henninger</p>

    <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
    <pre class="examples"><div class='input'><span class='kw'>if</span> <span class='op'>(</span><span class='cn'>FALSE</span><span class='op'>)</span> <span class='op'>{</span>
<span class='va'>mt_example</span> <span class='op'>&lt;-</span> <span class='fu'>mt_space_normalize</span><span class='op'>(</span><span class='va'>mt_example</span>,
  save_as <span class='op'>=</span><span class='st'>"sn_trajectories"</span>,
  start<span class='op'>=</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fl'>0</span>,<span class='fl'>0</span><span class='op'>)</span>, end<span class='op'>=</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='op'>-</span><span class='fl'>1</span>,<span class='fl'>1</span><span class='op'>)</span><span class='op'>)</span>
<span class='op'>}</span>
  
</div></pre>
  </div>
  <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
    <nav id="toc" data-toggle="toc" class="sticky-top">
      <h2 data-toc-skip>Contents</h2>
    </nav>
  </div>
</div>


      <footer>
      <div class="copyright">
  <p>Developed by Pascal J. Kieslich, Dirk U. Wulff, Felix Henninger, Jonas M. B. Haslbeck.</p>
</div>

<div class="pkgdown">
  <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
</div>

      </footer>
   </div>

  


  </body>
</html>


