-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.R
More file actions
44 lines (36 loc) · 779 Bytes
/
main.R
File metadata and controls
44 lines (36 loc) · 779 Bytes
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
'
Script : main
Created : February, 2015
Author(s) : iHub Research
Version : v1.0
License : Apache License, Version 2.0
'
#load pre-defined scripts
source('slice.R')
source('libraries.R')
source('settings.R')
source('slice.R')
source('score.R')
#load
library(TTR)
t0 = Sys.time()
res <- Slicer('raila',1000, csv=FALSE)
t1 = Sys.time() - t0
t1
#sentiment score
raila = as.data.frame(res)
for (i in 1:nrow(raila))
{
raila$sentiment_1[i] = score(as.character(raila$res[i]))
}
#================================================================================
t0 = Sys.time()
r <- Slicer('uhuru',1000, csv=FALSE)
t1 = Sys.time() - t0
t1
#sentiment score
uhuru = as.data.frame(r)
for (i in 1:nrow(uhuru))
{
uhuru$sentiment_2[i] = score(as.character(uhuru$r[i]))
}