setwd("~/github/projekt_opad/form/responses/")

files <- dir(pattern="csv") # this line gets all files in a directory that contains CSV files

results <- NULL # let's create empty object for all results

for (i in files){ # starting loop for all files
  tmp <- read.csv(i) # reading single CSV file
  results <- rbind(results,tmp) # binding temporary file to 'results' object
}

results # this is all we got
##            name age favourite_pkg terms  timestamp
## 1     sdalfanlj   8         dplyr  TRUE 1527003323
## 2   sdlfiajlsdj  NA  dfkalksjdmfj  TRUE 1527003429
## 3   ala ma kota  12      dlkafjlk  TRUE 1527003803
## 4 hgkkbkjhl;jnk  15       iugiugk  TRUE 1527004109
WriteXLS::WriteXLS(results, ExcelFileName = "results.xls") # saving as Excel spreadsheet