title: Loading multiple `csv` files containing comma or period as decimal point
body: <p>I typically receive <code>csv</code> files from Europe and the USA. Files from Europe have a comma and files from the USA have a period as the decimal point. I would like to be able to put all of those files into a single directory and load them with one function.</p>
  
  <p>Minimum working example:</p>
  
  <pre><code>write.table(data.frame("a" = 1.4, "b" = 2.5),  sep = ",",
          "periodFile1.csv", dec = ".", row.names = FALSE)
  write.table(data.frame("c" = 1.4, "d" = 2.5),  sep = ",",
          "periodFile2.csv", dec = ".", row.names = FALSE)
  </code></pre>
  
  <p>I have been using separate procedures for each type of decimal point.</p>
  
  <p>For a period as a decimal point I use the following:</p>
  
  <pre><code>periodNames &lt;-  list.files(pattern = "*.csv")
  lapply(seq_along(periodNames),
          function(x) read.csv(periodNames[x], dec = "."))
  </code></pre>
  
  <p>The following is not part of my routine procedure but is needed for the minimum working example otherwise the next load function would produce an error.</p>
  
  <p><code>file.remove(c("periodFile1.csv", "periodFile2.csv"))</code></p>
  
  <p>For a comma as a decimal point I use the following:</p>
  
  <pre><code>write.table(data.frame("e" = 2.7, "f" = 4.5), sep = ";", 
          "CommaFile1.csv", dec = ",", row.names = FALSE)
  write.table(data.frame("g" = 2.7, "h" = 4.5),  sep = ";", 
          "CommaFile2.csv", dec = ",", row.names = FALSE)
  commaNames &lt;-  list.files(pattern = "*.csv")
  lapply(seq_along(commaNames),
          function(x) read.csv(commaNames[x], dec = ",", sep = ";"))
  </code></pre>
  
  <p>I would like to be able to load all files into the workspace regardless of the type of decimal point. To do this, I hope to create a load function that checks for the type of decimal place and uses the appropriate load method.</p>
  
  <p>Many thanks in advance</p>