Created
December 3, 2014 06:20
-
-
Save emraher/66f28e8384a1c92fd789 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setwd("~/Dropbox/Tourism/Rdata") | |
rm(list=ls()) | |
# Libraries ==================================================================== | |
library("plyr") | |
library("reshape2") | |
# Start Merge ================================================================== | |
# See the following | |
# [1] http://goo.gl/9IojH8 | |
# [2] http://goo.gl/IP1wa9 | |
file_list <- list.files() | |
for (file in file_list){ | |
# if the merged dataset doesn't exist, create it | |
if (!exists("dataset")){ | |
dataset <- readRDS(file) | |
} | |
# if the merged dataset does exist, append to it | |
if (exists("dataset")){ | |
temp_dataset <- readRDS(file) | |
dataset <- rbind(dataset, temp_dataset) | |
rm(temp_dataset) | |
} | |
} | |
# Save | |
saveRDS(dataset, file = "Merged.rds") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment