-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmapping.r
More file actions
78 lines (69 loc) · 2.32 KB
/
mapping.r
File metadata and controls
78 lines (69 loc) · 2.32 KB
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
mainDir="E:/Dropbox/NPP/working_R"
plot.factor<-c("pop","pop.density","white","employed","AFF","income")
path0="E:/UW/summer2014/USNPP/shapefile2010"
#1 Alabama Browns Ferry
system.time(
for(i in 1:67)
{
npp.draw(myindex=i,plot.factor,path0,mainDir)
}
)
#histogram
for(myindex in 1:67)
{
mainDir="E:/Dropbox/NPP/working_R"
plot.factor<-c("pop","pop.density","white","employed","AFF","income")
path0="E:/UW/summer2014/USNPP/shapefile2010"
reg.data<-npp.regdata(short,geoid.NPP,index=myindex)
shape.frame<-npp.shapeframe(path=shape_path,index=myindex,geoid.NPP,neighbour,statename)
mapdata<-npp.mapdata(reg.data,shape.frame)
#draw pictures
for(i in plot.factor)
{
filename<-paste(NPP[myindex,"State"],"_",NPP[myindex,"Name"],"_",i,"_histogram.pdf",sep="")
dir.create(file.path(mainDir, "histogram",i), showWarnings = FALSE)
setwd(file.path(mainDir, "histogram",i))
histogram<-npp.hist(reg.data,i,NPP,myindex)
pdf<-pdf(file=filename,width=10, height=8)
print(histogram)
dev.off()
}
}
#plot
for(myindex in 1:67)
{
mainDir="E:/Dropbox/NPP/working_R"
plot.factor<-c("pop","pop.density","white","employed","AFF","income")
path0="E:/UW/summer2014/USNPP/shapefile2010"
reg.data<-npp.regdata(short,geoid.NPP,index=myindex)
#draw pictures
for(i in plot.factor)
{
filename2<-paste(NPP[myindex,"State"],"_",NPP[myindex,"Name"],"_",i,"_plot.pdf",sep="")
dir.create(file.path(mainDir, "plot",i), showWarnings = FALSE)
setwd(file.path(mainDir, "plot",i))
plotting<-npp.plot(wkdata=reg.data,interest=i,index=myindex)
pdf<-pdf(file=filename2,width=10, height=8)
print(plotting)
dev.off()
}
}
#mapping
for(myindex in 1:67)
{
mainDir="E:/Dropbox/NPP/working_R"
plot.factor<-c("pop","pop.density","white","employed","AFF","income")
path0="E:/UW/summer2014/USNPP/shapefile2010"
reg.data<-npp.regdata(short,geoid.NPP,index=myindex)
#draw pictures
for(i in plot.factor)
{
filename<-paste(NPP[myindex,"State"],"_",NPP[myindex,"Name"],"_",i,"_mapping.pdf",sep="")
dir.create(file.path(mainDir, "mapping",i), showWarnings = FALSE)
setwd(file.path(mainDir, "mapping",i))
mapping<-npp.mapping(regdata=reg.data,mapdata,NPP,index=myindex,factor.interest=plot.factor)
pdf<-pdf(file=filename,width=10, height=8)
print(mapping)
dev.off()
}
}