forked from gsbDBI/ExperimentData
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgettingDataIntoR.R
30 lines (22 loc) · 965 Bytes
/
gettingDataIntoR.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#####################################
# Reading processed datasets into R #
#####################################
# set the working directory
#work_dir should point to your local work dir
work_dir<'C:/temp/'
setwd(work_dir)
# clear things in RStudio
rm(list = ls())
# Loading data
# In each of five sub-folders with processed datasets, we illustrate how to
# read the data into R
filename.charitable <- 'Charitable/ProcessedData/charitable_withdummyvariables.csv'
charitable <- read.csv(filename.charitable)
filename.mobilization <- 'Mobilization/ProcessedData/mobilization_with_unlisted.csv'
mobilization <- read.csv(filename.mobilization)
filename.secrecy <- 'Secrecy/ProcessedData/ct_ballotsecrecy_processed.csv'
secrecy <- read.csv(filename.secrecy)
filename.social <- 'Social/ProcessedData/socialpressnofact.csv'
social <- read.csv(filename.social)
filename.welfare <- 'Welfare/ProcessedData/welfarenolabel3.csv'
welfare <- read.csv(filename.welfare)