title: R function returns unexpected input error
body: <pre><code>wmedian &lt;- function(directory, day) {
      files_list &lt;- list.files(directory, full.names = TRUE)
      dat &lt;- data.frame()
      for (i in 1:5) {
              dat &lt;- rbind(dat, read.csv(files_list[i]))
      }
      dat_subset &lt;- dat[which(dat[, "Day"] == day), ]
      median(dat_subset[, "Weight"], na.rm = TRUE)
  }
  </code></pre>
  
  <p>The above code is returning the following error in R when I try to define it ""rror: unexpected input in "wmedian &lt;- function(directory, day) {". I'm actually learning R right now and this code was straight from a tutorial. I tried re-writing the code, and also copy/pasting the code. Both are returning errors and I can't figure out why. What are your thoughts?<img src="https://i.stack.imgur.com/9Vg4B.png" alt="enter image description here"></p>
  
  <p>The goal of this function is to bind a set of csv files together, that have columns "Weight" and "Day". The function binds those files together and return the median of Weight for a given Day.</p>