Apply mean function for all variables
<p>I have two datasets A and B. I want to perform group and apply mean for  varibles wf,sd in dataset A and all the variables in dataset B</p>

<p>dataset A have variables as,df,er,wf,sd,gh,rt,we,sd,xc,as,df,fg,gh,rhj</p>

<p>dataset B have variables we,sd,xc,as,df,fg,gh,rhj,</p>

<pre><code>z&lt;-names(b)
dfdre&lt;-new %&gt;%
group_by( as,df,er) %&gt;%
summarize(numbobs =n(), wf= mean(wf), sd= mean(sd), z= mean(z) z= mean(z)) 
</code></pre>

<p>I know there is something wrong in the code. I am trying to apply mean for varaibles wf,sd and all the variables in dataset B.Could you please correct me?</p>