<!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.0"><title>mergeDS (assign function) called by ds.merge — mergeDS • dsBase</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 href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/simplex/bootstrap.min.css" rel="stylesheet" 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="mergeDS (assign function) called by ds.merge — mergeDS"><meta property="og:description" content="merges (links) two data.frames together based on common
values in defined vectors in each data.frame"><!-- 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">dsBase</a>
        <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">6.3.0</span>
      </span>
    </div>

    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav"><li>
  <a href="../reference/index.html">Reference</a>
</li>
      </ul><ul class="nav navbar-nav navbar-right"></ul></div><!--/.nav-collapse -->
  </div><!--/.container -->
</div><!--/.navbar -->

      

      </header><div class="row">
  <div class="col-md-9 contents">
    <div class="page-header">
    <h1>mergeDS (assign function) called by ds.merge</h1>
    
    <div class="hidden name"><code>mergeDS.Rd</code></div>
    </div>

    <div class="ref-description">
    <p>merges (links) two data.frames together based on common
values in defined vectors in each data.frame</p>
    </div>

    <div id="ref-usage">
    <div class="sourceCode"><pre class="sourceCode r"><code><span class="fu">mergeDS</span><span class="op">(</span>
  <span class="va">x.name</span>,
  <span class="va">y.name</span>,
  <span class="va">by.x.names.transmit</span>,
  <span class="va">by.y.names.transmit</span>,
  <span class="va">all.x</span>,
  <span class="va">all.y</span>,
  <span class="va">sort</span>,
  <span class="va">suffixes.transmit</span>,
  <span class="va">no.dups</span>,
  <span class="va">incomparables</span>
<span class="op">)</span></code></pre></div>
    </div>

    <div id="arguments">
    <h2>Arguments</h2>
    <dl><dt>x.name, </dt>
<dd><p>the name of the first data.frame to be merged specified in
inverted commas. Specified via argument &lt;x.name&gt; of ds.merge function</p></dd>


<dt>y.name, </dt>
<dd><p>the name of the second data.frame to be merged specified in
inverted commas. Specified via argument &lt;y.name&gt; of ds.merge function</p></dd>


<dt>by.x.names.transmit</dt>
<dd><p>the name of a single variable or a vector of names of
multiple variables (in transmittable form) containing the IDs or other data
on which data.frame x is to be merged/linked
to data.frame y. Specified via argument &lt;by.x.names&gt; of ds.merge function</p></dd>


<dt>by.y.names.transmit</dt>
<dd><p>the name of a single variable or a vector of names of
multiple variables (in transmittable form) containing the IDs or other data
on which data.frame y is to be merged/linked
to data.frame x. Specified via argument &lt;by.y.names&gt; of ds.merge function</p></dd>


<dt>all.x</dt>
<dd><p>logical, if TRUE, then extra rows will be added to the output,
one for each row in x that has no matching row in y. Specified via argument
&lt;all.x&gt; of ds.merge function. Default = FALSE.</p></dd>


<dt>all.y</dt>
<dd><p>logical, if TRUE, then extra rows will be added to the output,
one for each row in y that has no matching row in x. Specified via argument
&lt;all.y&gt; of ds.merge function. Default = FALSE.</p></dd>


<dt>sort</dt>
<dd><p>logical, if TRUE the merged result should be sorted on elements
in the by.x.names and by.y.names columns. Specified via
argument &lt;sort&gt; of ds.merge function. Default = TRUE.</p></dd>


<dt>suffixes.transmit</dt>
<dd><p>a character vector of length 2 (in transmittable form)
specifying the suffixes to be used for making unique common column names
in the two input data.frames when they both appear in the merged data.frame.
Specified via argument &lt;suffixes&gt; of ds.merge function. Default '.x' and '.y'.</p></dd>


<dt>no.dups</dt>
<dd><p>logical, when TRUE suffixes are appended in more cases to
rigorously avoid duplicated column names in the merged data.frame.
Specified via argument &lt;no.dups&gt; of ds.merge function. Default TRUE
but was apparently implicitly FALSE before R version 3.5.0.</p></dd>


<dt>incomparables, </dt>
<dd><p>values intended for merging on one column
which cannot be matched. See 'match' in help
for Native R merge function. Specified via argument &lt;incomparables&gt; of
ds.merge</p></dd>

</dl></div>
    <div id="value">
    <h2>Value</h2>
    

<p>the merged data.frame specified by the &lt;newobj&gt; argument
of ds.merge (or by default 'x.name_y.name' if the &lt;newobj&gt; argument
is NULL) which is written to the serverside. In addition,
two validity messages are returned to the clientside
indicating whether &lt;newobj&gt; has been created in each data source and if so whether
it is in a valid form. If its form is not valid in at least one study there may
be a studysideMessage that can explain the error in creating
the full output object. As well as appearing on the screen at run time,if you wish to
see the relevant studysideMessages at a later date you can use the ds.message</p>


<p>function. If you type ds.message(&lt;newobj&gt;) it will print out the relevant
studysideMessage from any datasource in which there was an error in creating &lt;newobj&gt;
and a studysideMessage was saved. If there was no error and &lt;newobj&gt; was created
without problems no studysideMessage will have been saved and ds.message(&lt;newobj&gt;)
will return the message: "ALL OK: there are no studysideMessage(s) on this datasource".</p>
    </div>
    <div id="details">
    <h2>Details</h2>
    <p>For further information see details of the native R function merge
and the DataSHIELD clientside function ds.merge.</p>
    </div>
    <div id="author">
    <h2>Author</h2>
    <p>Paul Burton, Demetris Avraam, for DataSHIELD Development Team</p>
    </div>

  </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></p><p>Developed by DataSHIELD Developers.</p>
</div>

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

      </footer></div>

  


  

  </body></html>

