Skip to content
This repository was archived by the owner on Jan 4, 2024. It is now read-only.

Commit f688c4a

Browse files
committed
clean some code files
1 parent 4f1b8b8 commit f688c4a

File tree

2 files changed

+1
-25
lines changed

2 files changed

+1
-25
lines changed

includes/rAnalyze.R

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,6 @@ os.hyundai <- dk.oppositesentiments(data.hyundai)
8686
os.toyota <- dk.oppositesentiments(data.toyota)
8787
os.vw <- dk.oppositesentiments(data.vw)
8888

89-
os <- os.ford
90-
os <- rbind(os, os.gm)
91-
os <- rbind(os, os.hyundai)
92-
os <- rbind(os, os.toyota)
93-
os <- rbind(os, os.vw)
94-
95-
fit <- lm(diff ~ rt.ratio, data=os)
96-
summary(fit)
97-
9889
data.ford$company <- "Ford"
9990
data.gm$company <- "GM"
10091
data.hyundai$company <- "Hyundai"
@@ -277,7 +268,6 @@ summary(lm(NoRt ~ lag, data = granger.lag))
277268
summary(lm(RT ~ lag, data = granger.lag))
278269
summary(lm(total ~ lag, data = granger.lag))
279270

280-
281271
positive.tweets <- data.frame(matrix(c(
282272
dk.sentimentstats(data.ford),
283273
dk.sentimentstats(data.gm),

includes/rfunctions.R

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -142,18 +142,11 @@ dk.load <- function(tweetFile, indicesFile, omitRt = F) {
142142

143143
dk.show <- function(df) {
144144
melted <- melt(df[c(1:5,8)], id.vars='date', variable.name='type')
145-
# copy the dategroups
146145
melted$dategroup <- df$dategroup
147-
148-
#https://stackoverflow.com/questions/21529332/how-to-not-plot-gaps-in-timeseries-with-r
149-
150146
legendtitle <- "Legend"
151-
152147
grouptitles <- paste("Group", 1:length(unique(melted$dategroup)))
153148
names(grouptitles) <- unique(melted$dategroup)
154-
155149
levels(melted$type) <- c("$S_{TB}$", "$S_{NB}$","$S_{ME}$", "$S_{SVM}$", "$P_{Share}$")
156-
157150
lineValues <- c(1,1,1,1,2,0)
158151

159152
ggplot(melted, aes(date, value, color=type)) +
@@ -169,17 +162,12 @@ dk.show <- function(df) {
169162
dk.showsentiments <- function(df) {
170163
melted <- melt(df[1:5], id.vars='date', variable.name='type')
171164
# copy the dategroups
172-
melted$dategroup <- df$dategroup
173-
165+
melted$dategroup <- df$dategroup
174166
#https://stackoverflow.com/questions/21529332/how-to-not-plot-gaps-in-timeseries-with-r
175-
176167
legendtitle <- "Legend"
177-
178168
grouptitles <- paste("Group", 1:length(unique(melted$dategroup)))
179169
names(grouptitles) <- unique(melted$dategroup)
180-
181170
levels(melted$type) <- c("$S_{TB}$", "$S_{NB}$","$S_{ME}$", "$S_{SVM}$")
182-
183171
lineValues <- c(1,1,1,1,0,0)
184172

185173
ggplot(melted, aes(date, value, color=type)) +
@@ -300,8 +288,6 @@ dk.granger <- function(df) {
300288
i <- 1
301289
while(i < 11) {
302290
# y ~ model
303-
# y wird erklärt durch model
304-
# Close wird erklärt durch SA_X
305291
x$SA_TB[i] <- grangertest(Close ~ SA_TB, order = i, data = df)[2,4]
306292
x$SA_NB[i] <- grangertest(Close ~ SA_NB, order = i, data = df)[2,4]
307293
x$SA_ME[i] <- grangertest(Close ~ SA_ME, order = i, data = df)[2,4]

0 commit comments

Comments
 (0)