<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>dplyr on Choyang</title>
    <link>/tags/dplyr/</link>
    <description>Recent content in dplyr on Choyang</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 13 Mar 2020 00:00:00 +0000</lastBuildDate><atom:link href="/tags/dplyr/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Rowwise operation in dplyr 1.0.0</title>
      <link>/post/rowwise-operation-in-dplyr-1-0-0/</link>
      <pubDate>Fri, 13 Mar 2020 00:00:00 +0000</pubDate>
      
      <guid>/post/rowwise-operation-in-dplyr-1-0-0/</guid>
      <description>I have written a post on rowwise operation of data frame in R a while ago. purrr::pmap() is recommended for rowwise operation in that post, since other methods have their own disadvantages. However, there will be a better rowwise operation support in dplyr 1.0.0 (will be released soon), and it is very intuitive, simple, easy to use.
Basic library(dplyr) df &amp;lt;- tibble(x = 1:3, y = 2:4, z = 3:5) df %&amp;gt;% rowwise() %&amp;gt;% mutate(m = mean(c(x, y, z))) ## # A tibble: 3 x 4 ## # Rowwise: ## x y z m ## &amp;lt;int&amp;gt; &amp;lt;int&amp;gt; &amp;lt;int&amp;gt; &amp;lt;dbl&amp;gt; ## 1 1 2 3 2 ## 2 2 3 4 3 ## 3 3 4 5 4 We can use tidy selection syntax to succinctly select any variables with c_across().</description>
    </item>
    
  </channel>
</rss>
