title: R: How to automatically calculate the mean of all variables of a dataset?
body: <p>I read in a csv file via:</p>
  
  <pre><code>data = read.csv("airbnb.csv",header=T,sep=",")
  </code></pre>
  
  <p>data has over 100 variables and I need to calculate the mean of all of them. Actually I need to automate the following:</p>
  
  <pre><code>mean(data$variable1)
  mean(data$variable2)
  </code></pre>
  
  <p>....</p>
  
  <p>Is there any nice way I can do this? E.g. with a loop?</p>