<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html>
  <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>read_mousetracker â€¢ mousetrap</title>

<!-- jquery -->
<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script>
<!-- Bootstrap -->

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

<!-- Font Awesome icons -->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">


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

<!-- mathjax -->
<script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></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>
    <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">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="../index.html">mousetrap</a>
    </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="fa 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>Read data exported from MouseTracker.</h1>
    </div>

    
    <p><code>read_mousetracker</code> imports data that was collected using MouseTacker 
(Freeman &amp; Ambady, 2010) and exported to a <code>.csv</code> file through 
MouseTracker Analyzer. It focuses on the raw data, and provides several 
options to remove pre-processed aggregate data (see Details).</p>
    

    <pre><span class='fu'>read_mousetracker</span>(<span class='no'>file</span>, <span class='kw'>remove_mean_data</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>last_lines_to_rm</span> <span class='kw'>=</span> <span class='fl'>0</span>,
  <span class='kw'>remove_empty_columns</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</pre>
    
    <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a> Arguments</h2>
    <dl class="dl-horizontal">
      <dt>file</dt>
      <dd>a character string. The name of the file which the data are to be
read from. If it does not contain an absolute path, the file name is 
relative to the current working directory.</dd>
      <dt>remove_mean_data</dt>
      <dd>logical indicating if mean subject data (i.e., the 
aggregated trajectories) should be automatically detected and removed. This
only works for data from &quot;time normalized analysis&quot; in MouseTracker (see 
Details).</dd>
      <dt>last_lines_to_rm</dt>
      <dd>integer indicating the number of last lines to omit 
from the imported data set. Typically used for data from &quot;raw time 
analysis&quot; in MouseTracker (see Details). This option is independent of 
<code>remove_mean_data</code>. The removal of the last lines is performed after 
the optional removal of the auto-detected mean data.</dd>
      <dt>remove_empty_columns</dt>
      <dd>logical indicating whether columns containing NAs
only should be removed.</dd>
    </dl>
    
    <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>

    <p>A data.frame.</p>
    
    <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>

    <p>MouseTracker by default includes the (per subject) aggregated trajectories in
the exported data set. As these are typically not desired in the trial-based 
dataset, <code>read_mousetracker</code> provides several ways of removing them.</p>
    <p>Data that stem from a &quot;time normalized analysis&quot; in MouseTracker Analyzer, 
can be read into R using <code>read_mousetracker</code> with default arguments (the
aggregated trajectory data are automatically detected and removed, as they 
are marked by a row labeled &quot;MEAN SUBJECT-BY-SUBJECT DATA&quot; in the <code>.csv</code>
file).</p>
    <p>Data that stem from a &quot;raw time analysis&quot; in MouseTracker Analyzer, also 
usually contain the aggregated trajectory data. However, as they are not 
marked by a specific row label in the <code>.csv</code> file, the number of last 
lines that should be omitted has to be specified explicitly using the 
argument <code>last_lines_to_rm</code>. Typically, this number is two times the 
number of data files.</p>
    <p>After reading the data into R, <a href='mt_import_wide.html'>mt_import_wide</a> can be used to prepare 
the trajectory data for analyses using the mousetrap library.</p>
    <p>The current version of <code>read_mousetracker</code> has been tested with data 
exported from MouseTracker Version 2.82.</p>
    
    <h2 class="hasAnchor" id="references"><a class="anchor" href="#references"></a>References</h2>

    <p>Freeman, J. B., &amp; Ambady, N. (2010). MouseTracker: Software for
studying real-time mental processing using a computer mouse-tracking method. 
<em>Behavior Research Methods, 42</em>(1), 226-241.</p>
    
    <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>

    <p><a href='mt_import_wide.html'>mt_import_wide</a> to prepare the trajectory data for analyses in mousetrap.</p>
    

    <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
    <pre class="examples"><div class='input'><span class='co'>## Not run: ------------------------------------</span>
<span class='co'># # Data from "time normalized analysis" in MouseTracker</span>
<span class='co'># raw_data &lt;- read_mousetracker("tn_data_exported.csv")</span>
<span class='co'># </span>
<span class='co'># # Data from "raw time analysis" in MouseTracker</span>
<span class='co'># raw_data &lt;- read_mousetracker("raw_data_exported.csv",last_lines_to_rm=2*8)</span>
<span class='co'>## ---------------------------------------------</span></div></pre>
  </div>
  <div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
    <h2>Contents</h2>
    <ul class="nav nav-pills nav-stacked">
      <li><a href="#arguments">Arguments</a></li>
      
      <li><a href="#value">Value</a></li>

      <li><a href="#details">Details</a></li>

      <li><a href="#references">References</a></li>

      <li><a href="#see-also">See also</a></li>
      
      <li><a href="#examples">Examples</a></li>
    </ul>

  </div>
</div>

      <footer>
      <div class="copyright">
  <p>Developed by Pascal J. Kieslich, Felix Henninger.</p>
</div>

<div class="pkgdown">
  <p>Site built with <a href="http://hadley.github.io/pkgdown/">pkgdown</a>.</p>
</div>

      </footer>
   </div>

  </body>
</html>
