-
Notifications
You must be signed in to change notification settings - Fork 0
/
4_ExplorData-Analysis.R
131 lines (108 loc) · 5.03 KB
/
4_ExplorData-Analysis.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#********************************************
# #
# Explorative - Datenanalyse #
# #
#********************************************
#install.packages("googleVis","ggplot2", "beanplot","rgdal","sp",
# "leafletR","plotGoogleMaps","GeoXp",
# "gridExtra", "plyr","vioplot")
#install.packages(c("devtools","RJSONIO", "knitr", "shiny", "httpuv"))
require(devtools)
install_github('rCharts', 'ramnathv')
library("rCharts")
install_github("mages/googleVis")
library("googleVis")
library("ggplot2")
library("beanplot")
library("rgdal")
library("sp")
library("leafletR")
library("plotGoogleMaps")
library("GeoXp")
library("gridExtra")
library("plyr")
library("vioplot")
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Variablen für Explorative Datenanalys generieren =================
ExDF <- LORdataWIDE
names(ExDF)
JLLdataEx <- subset(JLLdata, JLLdata$Zeit>=2008)
JLLdataExwide <- reshape(JLLdataEx,
idvar = c("PLZ"),
v.names = c("Miete_H1",
"Miete_H2"),
timevar = "Zeit",
direction = "wide")
View(JLLdataEx)
JLLdataSUMMARY <- ddply(JLLdataEx,
"PLZ", summarize,
MieteH1_min = min(Miete_H1),
MieteH1_max = max(Miete_H1),
MieteH1_range = max(Miete_H1)-min(Miete_H1),
MieteH1_sd = round(sd(Miete_H1), digits = 2))
par(mfrow=c(1,1))
vioMIN <- vioplot(na.omit(JLLdataSUMMARY$MieteH1_min) , horizontal=F, names="min")
vioMAX <- vioplot(na.omit(JLLdataSUMMARY$MieteH1_max) , horizontal=F, names="max")
vioRANGE <- vioplot(na.omit(JLLdataSUMMARY$MieteH1_range), horizontal=F, names="range")
vioSD <- vioplot(na.omit(JLLdataSUMMARY$MieteH1_sd) , horizontal=F, names="sd")
vioplot(na.omit(JLLdataSUMMARY$MieteH1_min),
na.omit(JLLdataSUMMARY$MieteH1_max),
horizontal=F,
names=c("min","max"))
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Scatter Plots mit size proportional zur EW Zahl =================
sctr_PDAU5chg <- ggplot(ExDF, aes(BEZ_NAME, PDAU5chg), weight=E_E.2012) +
geom_jitter(aes(colour=BEZ_NAME, size = E_E.2012),
position = position_jitter(width = .3)) +
scale_size_continuous(breaks=c(1000,5000,10000,20000), range=c(1,10)) +
geom_hline(yintercept=0, col="black")
sctr_PDAU5chg
sctr_PDAU10chg <- ggplot(ExDF, aes(BEZ_NAME, PDAU10chg), weight=E_E.2012) +
geom_jitter(aes(colour=BEZ_NAME, size = E_E.2012),
position = position_jitter(width = .3)) +
scale_size_continuous(breaks=c(1000,5000,10000,20000), range=c(1,10)) +
geom_hline(yintercept=0, col="black")
sctr_PDAU10chg
sctr_PDAU5chg <- ggplot(ExDF, aes(BEZ_NAME, PDAU5chg), weight=E_E.2012) +
geom_jitter(aes(colour=BEZ_NAME, size = E_E.2012),
position = position_jitter(width = .3)) +
scale_size(breaks=c(1000,5000,10000,20000), range=c(1,10)) +
geom_hline(yintercept=0, col="black")
sctr_PDAU5chg
# LOR Motion Chart
names(LORdataFULL)
LORdata4ggvis <- LORdataFULL
LORdata4ggvis$ZEIT <- as.numeric(as.character(LORdata4ggvis$ZEIT))
LORgvisMotion <- gvisMotionChart(LORdata4ggvis,
idvar = "RAUMID_NAME",
timevar = "ZEIT",
sizevar = "E_E",
colorvar= "BEZ_NAME",
options=list(width=1200, height=700))
plot(LORgvisMotion)
# PLZ Miete Motion Chart --> 12049 Schillerpromenade mal anschauen!
str(JLLdata)
JLLdata4ggvis <- JLLdata
JLLgvisMotion <- gvisMotionChart(JLLdata4ggvis,
idvar = "PLZ",
timevar = "Zeit",
options=list(width=1200, height=700))
plot(JLLgvisMotion)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# BEISPIELE rCHARTS
names(iris) = gsub("\\.", "", names(iris))
rPlot(SepalLength ~ SepalWidth | Species, data = iris, color = 'Species', type = 'point')
hair_eye = as.data.frame(HairEyeColor)
rPlot(Freq ~ Hair | Eye, color = 'Eye', data = hair_eye, type = 'bar')
r1 <- rPlot(mpg ~ wt | am + vs, data = mtcars, type = "point", color = "gear");r1
hair_eye_male <- subset(as.data.frame(HairEyeColor), Sex == "Male")
n1 <- nPlot(Freq ~ Hair, group = "Eye", data = hair_eye_male, type = "multiBarChart");n1
h1 <- hPlot(x = "Wr.Hnd", y = "NW.Hnd",
data = MASS::survey,
type = c("line", "bubble", "scatter"),
group = "Clap",
size = "Age")
h1
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~