# clearing the memory

rm(list=ls())
gc()

# loading packages

library(readr)
library(dplyr)
library(tidyr)
library(tidyverse)
library(data.table)

# importing and combining the data

aLife10_super_2010 <- fread("G:/aLifeData/ALife2018a/csv/aLife10_super_2010.csv", 
                            select = vars)
aLife10_super_2011 <- fread("G:/aLifeData/ALife2018a/csv/aLife10_super_2011.csv", 
                            select = vars)
combined_dataset <- bind_rows(aLife10_super_2010, aLife10_super_2011)
rm("aLife10_super_2010", "aLife10_super_2011")
gc()
aLife10_super_2012 <- fread("G:/aLifeData/ALife2018a/csv/aLife10_super_2012.csv", 
                            select = vars)
combined_dataset <- bind_rows(combined_dataset, aLife10_super_2012)
rm("aLife10_super_2012")
gc()
aLife10_super_2013 <- fread("G:/aLifeData/ALife2018a/csv/aLife10_super_2013.csv", 
                            select = vars)
combined_dataset <- bind_rows(combined_dataset, aLife10_super_2013)
rm("aLife10_super_2013")
gc()
aLife10_super_2014 <- fread("G:/aLifeData/ALife2018a/csv/aLife10_super_2014.csv", 
                            select = vars)
combined_dataset <- bind_rows(combined_dataset, aLife10_super_2014)
rm("aLife10_super_2014")
gc()
aLife10_super_2015 <- fread("G:/aLifeData/ALife2018a/csv/aLife10_super_2015.csv", 
                            select = vars)
combined_dataset <- bind_rows(combined_dataset, aLife10_super_2015)
rm("aLife10_super_2015")
gc()
aLife10_super_2016 <- fread("G:/aLifeData/ALife2018a/csv/aLife10_super_2016.csv", 
                            select = vars)
combined_dataset <- bind_rows(combined_dataset, aLife10_super_2016)
rm("aLife10_super_2016")
gc()
aLife10_super_2017 <- fread("G:/aLifeData/ALife2018a/csv/aLife10_super_2017.csv", 
                            select = vars)
combined_dataset <- bind_rows(combined_dataset, aLife10_super_2017)
rm("aLife10_super_2017")
gc()
aLife10_super_2018 <- fread("G:/aLifeData/ALife2018a/csv/aLife10_super_2018.csv", 
                            select = vars)
combined_dataset <- bind_rows(combined_dataset, aLife10_super_2018)
rm("aLife10_super_2018")
gc()

# saving the dataset

save.image("~/aLife_super_data_trimmed.RData")