<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Tidyverse on thothal.com</title>
		<link>https://www.thothal.com/tags/tidyverse/</link>
		<description>Recent content in Tidyverse on thothal.com</description>
		<generator>Hugo</generator>
		<language>en-US</language>
		
		
		
		
			<lastBuildDate>Thu, 10 Mar 2022 00:00:00 +0000</lastBuildDate>
		
			<atom:link href="https://www.thothal.com/tags/tidyverse/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Aggregate Data with Nested Groups</title>
				<link>https://www.thothal.com/2022/03/10/aggregate-data-with-nested-groups/</link>
				<pubDate>Thu, 10 Mar 2022 00:00:00 +0000</pubDate>
				<guid>https://www.thothal.com/2022/03/10/aggregate-data-with-nested-groups/</guid>
				<description>&lt;link href=&#34;https://www.thothal.com/2022/03/10/aggregate-data-with-nested-groups/index.en_files/htmltools-fill/fill.css&#34; rel=&#34;stylesheet&#34; /&gt;&#xD;&#xA;&lt;script src=&#34;https://www.thothal.com/2022/03/10/aggregate-data-with-nested-groups/index.en_files/htmlwidgets/htmlwidgets.js&#34;&gt;&lt;/script&gt;&#xD;&#xA;&lt;script src=&#34;https://www.thothal.com/2022/03/10/aggregate-data-with-nested-groups/index.en_files/plotly-binding/plotly.js&#34;&gt;&lt;/script&gt;&#xD;&#xA;&lt;script src=&#34;https://www.thothal.com/2022/03/10/aggregate-data-with-nested-groups/index.en_files/typedarray/typedarray.min.js&#34;&gt;&lt;/script&gt;&#xD;&#xA;&lt;script src=&#34;https://www.thothal.com/2022/03/10/aggregate-data-with-nested-groups/index.en_files/jquery/jquery.min.js&#34;&gt;&lt;/script&gt;&#xD;&#xA;&lt;link href=&#34;https://www.thothal.com/2022/03/10/aggregate-data-with-nested-groups/index.en_files/crosstalk/css/crosstalk.min.css&#34; rel=&#34;stylesheet&#34; /&gt;&#xD;&#xA;&lt;script src=&#34;https://www.thothal.com/2022/03/10/aggregate-data-with-nested-groups/index.en_files/crosstalk/js/crosstalk.min.js&#34;&gt;&lt;/script&gt;&#xD;&#xA;&lt;link href=&#34;https://www.thothal.com/2022/03/10/aggregate-data-with-nested-groups/index.en_files/plotly-htmlwidgets-css/plotly-htmlwidgets.css&#34; rel=&#34;stylesheet&#34; /&gt;&#xD;&#xA;&lt;script src=&#34;https://www.thothal.com/2022/03/10/aggregate-data-with-nested-groups/index.en_files/plotly-main/plotly-latest.min.js&#34;&gt;&lt;/script&gt;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&lt;div id=&#34;a-short-general-primer-on-loops&#34; class=&#34;section level2&#34;&gt;&#xD;&#xA;&lt;h2&gt;A Short General Primer on Loops&lt;/h2&gt;&#xD;&#xA;&lt;p&gt;In my daily programming I barely use any base &lt;code&gt;for&lt;/code&gt; loops. I used to rely on &lt;code&gt;lapply&lt;/code&gt;&#xD;&#xA;and friends a lot, then switched to the &lt;code&gt;plyr&lt;/code&gt; family of apply functions and eventually&#xD;&#xA;ended up using the &lt;code&gt;purr::map_*&lt;/code&gt; family of functions.&lt;/p&gt;&#xD;&#xA;&lt;p&gt;There is a bit of overhead involved in &lt;code&gt;map&lt;/code&gt;and &lt;code&gt;[lvs]apply&lt;/code&gt; can be faster / more efficient,&#xD;&#xA;but I do like the verbosity of &lt;code&gt;map&lt;/code&gt; and friends as well as the possibility to use&#xD;&#xA;lambda functions via &lt;code&gt;~&lt;/code&gt;&lt;a href=&#34;#fn1&#34; class=&#34;footnote-ref&#34; id=&#34;fnref1&#34;&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;.&#xD;&#xA;Especially the predictability of the result as opposed to &lt;code&gt;sapply&lt;/code&gt; for instance is a clear&#xD;&#xA;plus. Also, if you want the apply function to return something else than a list the&#xD;&#xA;&lt;code&gt;map_*&lt;/code&gt; variants become rather handy.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
