<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/r-3-4-2-is-released-with-several-bug-fixes-and-a-few-performance-improvements/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://www.r-statistics.com/2017/09/r-3-4-2-is-released-with-several-bug-fixes-and-a-few-performance-improvements/"> R – R-statistics blog</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>R 3.4.2 (codename “Short Summer”) was <a rel="nofollow" href="https://stat.ethz.ch/pipermail/r-announce/2017/000619.html" target="_blank">released yesterday</a>. You can get the latest binaries version <strong><a rel="nofollow" href="https://cran.rstudio.com/" target="_blank">from here</a>.</strong> (or the .tar.gz <strong>source</strong> code from <a rel="nofollow" href="https://cran.r-project.org/src/base/R-3/R-3.4.2.tar.gz" target="_blank">here</a>).</p>
<p>As mentioned by <a rel="nofollow" href="http://blog.revolutionanalytics.com/2017/09/r-342-is-released.html" target="_blank">David Smith</a>, R 3.4.2 includes a performance improvement for names:</p>
<blockquote><p><code>c()</code> and <code>unlist()</code> are now more efficient in constructing the <code>names(.)</code> of their return value, thanks to a proposal by Suharto Anggono. (<a rel="nofollow" href="https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17284" target="_blank">PR#17284</a>)</p>
</blockquote>
<p>The full list of bug fixes and new features is provided below.</p>
<h3>Thank you <span data-hovercard-id="murdoch.duncan@gmail.com">Duncan Murdoch</span> !</h3>
<p>On a related note, following the announcement on R 3.4.2, Duncan Murdoch <a rel="nofollow" href="https://stat.ethz.ch/pipermail/r-announce/2017/000620.html" target="_blank">wrote yesterday</a>:</p>
<blockquote><p>I’ve just finished the Windows build of R 3.4.2.  It will make it to CRAN and its mirrors over the next few hours.</p>
<p>This is the last binary release that I will be producing.  I’ve been building them for about 15 years, and it’s time to retire.  Builds using different tools and scripts are available from <a rel="nofollow" href="https://mran.microsoft.com/download/" data-saferedirecturl="https://www.google.com/url?hl=en&amp;q=https://mran.microsoft.com/download/&amp;source=gmail&amp;ust=1506793101849000&amp;usg=AFQjCNHzjuPM2ZT5QSd5iFiUX-64TW8HdQ" target="_blank">https://mran.microsoft.com/download/</a>.  I’ll be putting my own scripts on CRAN soon in case anyone wants to duplicate them.</p>
<p>Nightly builds of R-patched and R-devel will continue to run on autopilot for the time being, without maintenance.</p>
<p>I will also be retiring from maintenance of the Rtools collection.</p>
</blockquote>
<p>I am grateful to Duncan for contributing so much of his time and expertise throughout the years. And I am confident that other R users, using the binaries for the Windows OS, share this sentiment.</p>
<h3>Upgrading to R 3.4.2 on Windows</h3>
<p>If you are using <strong>Windows </strong>you can easily upgrade to the latest version of R using <a rel="nofollow" href="https://cran.r-project.org/web/packages/installr/" target="_blank">the installr package</a>. Simply run the following code in Rgui:</p>
<div>
<table>
<tr>
<td>
<pre><span>install.<span>packages</span></span><span>(</span><span>&quot;installr&quot;</span><span>)</span> <span># install </span>
setInternet2<span>(</span>TRUE<span>)</span> <span># only for R versions older than 3.3.0</span>
installr<span>::</span><span>updateR</span><span>(</span><span>)</span> <span># updating R.</span>
<span># If you wish it to go faster, run: installr::updateR(T)</span></pre>
</td>
</tr>
</table>
</div>
<p>Running “updateR()” will detect if there is a new R version available, and if so it will download+install it (etc.). There is also <a rel="nofollow" href="https://www.r-statistics.com/2015/06/a-step-by-step-screenshots-tutorial-for-upgrading-r-on-windows/" target="_blank">a step by step tutorial (with screenshots) on how to upgrade R on Windows, using the <em>installr</em></a> package. If you only see the option to upgrade to an older version of R, then change your mirror or try again in a few hours (it usually take around 24 hours for all CRAN mirrors to get the latest version of R).</p>
<p><em>I try to keep the <a rel="nofollow" href="https://github.com/talgalili/installr" target="_blank">installr</a> package updated and useful, so if you have any suggestions or remarks on the package – you are invited to <a rel="nofollow" href="https://github.com/talgalili/installr/issues" target="_blank">open an issue in the github page</a>.</em></p>
<p><span></span></p>
<h3>CHANGES IN R 3.4.2</h3>
<h4>NEW FEATURES</h4>
<ul>
<li>Setting the <code>LC_ALL</code> category in <code>Sys.setlocale()</code> invalidates any cached locale-specific day/month names and the AM/PM indicator for <code>strptime()</code> (as setting <code>LC_TIME</code> has since <b>R</b> 3.1.0).</li>
<li>The version of LAPACK included in the sources has been updated to 3.7.1, a bug-fix release.</li>
<li>The default for <code>tools::write_PACKAGES(rds_compress=)</code> has been changed to <code>&quot;xz&quot;</code> to match the compression used by <acronym><span>CRAN</span></acronym>.</li>
<li><code>c()</code> and <code>unlist()</code> are now more efficient in constructing the <code>names(.)</code> of their return value, thanks to a proposal by Suharto Anggono. (<a rel="nofollow" href="https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17284" target="_blank">PR#17284</a>)</li>
</ul>
<h4>UTILITIES</h4>
<ul>
<li><code>R CMD check</code> checks for and <code>R CMD build</code> corrects CRLF line endings in shell scripts <code>configure</code> and <code>cleanup</code> (even on Windows).</li>
</ul>
<h4>INSTALLATION on a UNIX-ALIKE</h4>
<ul>
<li>The order of selection of OpenMP flags has been changed: Oracle Developer Studio 12.5 accepts <span>-fopenmp</span> and <span>-xopenmp</span> but only the latter enables OpenMP so it is now tried first.</li>
</ul>
<h4>BUG FIXES</h4>
<ul>
<li><code>within(List, rm(x1, x2))</code> works correctly again, including when <code>List[[&quot;x2&quot;]]</code> is <code>NULL</code>.</li>
<li><code>regexec(pattern, text, *)</code> now applies <code>as.character(.)</code> to its first two arguments, as documented.</li>
<li><code>write.table()</code> and related functions, <code>writeLines()</code>, and perhaps other functions writing text to connections did not signal errors when the writes failed, e.g. due to a disk being full. Errors will now be signalled if detected during the write, warnings if detected when the connection is closed. (<a rel="nofollow" href="https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17243" target="_blank">PR#17243</a>)</li>
<li><code>rt()</code> assumed the <code>ncp</code> parameter was a scalar. (<a rel="nofollow" href="https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17306" target="_blank">PR#17306</a>)</li>
<li><code>menu(choices)</code> with more than 10 choices which easily fit into one <code>getOption(&quot;width&quot;)</code>-line no longer erroneously repeats choices. (<a rel="nofollow" href="https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17312" target="_blank">PR#17312</a>)</li>
<li><code>length()&lt;-</code> on a pairlist succeeds. (<a rel="nofollow" href="https://stat.ethz.ch/pipermail/r-devel/2017-July/074680.html" target="_blank">https://stat.ethz.ch/pipermail/r-devel/2017-July/074680.html</a>)</li>
<li>Language objects such as <code>quote((&quot;\n&quot;))</code> or <b>R</b> functions are correctly printed again, where <b>R</b> 3.4.1 accidentally duplicated the backslashes.</li>
<li>Construction of <code>names()</code> for very large objects in <code>c()</code> and <code>unlist()</code> now works, thanks to Suharto Anggono’s patch proposals in <a rel="nofollow" href="https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17292" target="_blank">PR#17292</a>.</li>
<li>Resource leaks (and similar) reported by Steve Grubb fixed. (<a rel="nofollow" href="https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17314" target="_blank">PR#17314</a>, <a rel="nofollow" href="https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17316" target="_blank">PR#17316</a>, <a rel="nofollow" href="https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17317" target="_blank">PR#17317</a>, <a rel="nofollow" href="https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17318" target="_blank">PR#17318</a>, <a rel="nofollow" href="https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17319" target="_blank">PR#17319</a>, <a rel="nofollow" href="https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17320" target="_blank">PR#17320</a>)</li>
<li><code>model.matrix(~1, mf)</code> now gets the row names from <code>mf</code> also when they differ from <code>1:nrow(mf)</code>, fixing <a rel="nofollow" href="https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14992" target="_blank">PR#14992</a> thanks to the suggestion by Sebastian Meyer.</li>
<li><code>sigma(fm)</code> now takes the correct denominator degrees of freedom for a fitted model with <code>NA</code> coefficients. (<a rel="nofollow" href="https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17313" target="_blank">PR#17313</a>)</li>
<li><code>hist(x, &quot;FD&quot;)</code> no longer “dies” with a somewhat cryptic error message when <code>x</code> has extreme outliers or <code>IQR()</code> zero: <code>nclass.FD(x)</code> tries harder to find a robust bin width <i>h</i> in the latter case, and <code>hist.default(*, breaks)</code> now checks and corrects a too large <code>breaks</code> number. (<a rel="nofollow" href="https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17274" target="_blank">PR#17274</a>)</li>
<li><code>callNextMethod()</code> works for <code>...</code> methods.</li>
<li><code>qr.coef(qd, y)</code> now has correct names also when <code>qd</code> is a complex QR or stems from <code>qr(*, LAPACK=TRUE)</code>.</li>
<li>Setting <code>options(device = *)</code> to an invalid function no longer segfaults when plotting is initiated. (<a rel="nofollow" href="https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=15883" target="_blank">PR#15883</a>)</li>
<li><code>encodeString(</code></ul>