forked from UCDavisLibrary/ava
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.Rhistory
502 lines (502 loc) · 30.5 KB
/
.Rhistory
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
b <- gsheet2tbl(url)
library(gsheet)
url<-"https://docs.google.com/spreadsheets/d/1T__ll_KSmDmYkKb-KA-lPcxcsO5_bMUxZz38KmqnXPA/edit#gid=782537192"
a <- gsheet2text(url, format='tsv')
#b <- read.csv(a, stringsAsFactors=FALSE)
b <- gsheet2tbl(url)
xday<-b$Timestamp
z<-strptime(xday, "%m/%d/%Y %H:%M:%S")
hist(z, breaks=10)
hist(z, breaks=10, freq = TRUE)
hist(z, breaks=10, freq = TRUE, title = "Timeline of QGIS Workshop Registration")
hist(z, breaks=10, freq = TRUE, main = "Timeline of QGIS Workshop Registration")
starttime<-strptime("9/18/2017 14:47", "%m/%d/%Y %H:%M:%S")
fromstart<-starttime-z)
fromstart<-starttime-z
fromstart
starttime
starttime<-strptime("9/18/2017 14:47", "%m/%d/%Y %H:%M")
fromstart<-starttime-z
fromstart
fromstart<-z-starttime
fromstart
hist(fromstart, breaks=10, freq = TRUE, main = "Timeline of QGIS Workshop Registration")
str(fromstart)
hist(as.numeric(fromstart), breaks=10, freq = TRUE, main = "Timeline of QGIS Workshop Registration")
hist(as.numeric(fromstart/60), breaks=10, freq = TRUE, main = "Timeline of QGIS Workshop Registration")
hist(as.numeric(fromstart/60), breaks=10, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from announcement email", ylab="Number of Registrations")
hist(as.numeric(fromstart/60), breaks=10, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email", ylab="Number of Registrations")
hist(as.numeric(fromstart/60), breaks=10, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations")
hist(as.numeric(fromstart/60), breaks=10, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray")
hist(as.numeric(fromstart/60), breaks=10, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray", ylim=30)
hist(as.numeric(fromstart/60), breaks=10, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray", ylim=c(0,30))
hist(as.numeric(fromstart/60), breaks=10, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray", xlim=c(0,30))
hist(as.numeric(fromstart/60), breaks=10, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray", xlim=c(0,25))
hist(as.numeric(fromstart/60), breaks=25, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray", xlim=c(0,25))
hist(as.numeric(fromstart/60), breaks=20, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray", xlim=c(0,25))
hist(as.numeric(fromstart/60), breaks=15, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray", xlim=c(0,25))
library(gsheet)
url<-"https://docs.google.com/spreadsheets/d/1T__ll_KSmDmYkKb-KA-lPcxcsO5_bMUxZz38KmqnXPA/edit#gid=782537192"
a <- gsheet2text(url, format='tsv')
#b <- read.csv(a, stringsAsFactors=FALSE)
b <- gsheet2tbl(url)
xday<-b$Timestamp
z<-strptime(xday, "%m/%d/%Y %H:%M:%S")
#hist(z, breaks=10, freq = TRUE, main = "Timeline of QGIS Workshop Registration")
starttime<-strptime("9/18/2017 14:47", "%m/%d/%Y %H:%M")
#time in minutes from the first email being sent
fromstart<-z-starttime
hist(as.numeric(fromstart/60), breaks=15, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray", xlim=c(0,25))
hist(as.numeric(fromstart/60), breaks=15, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray", xlim=c(0,30))
Sys.Date()
library(gsheet)
url<-"https://docs.google.com/spreadsheets/d/1T__ll_KSmDmYkKb-KA-lPcxcsO5_bMUxZz38KmqnXPA/edit#gid=782537192"
a <- gsheet2text(url, format='tsv')
#b <- read.csv(a, stringsAsFactors=FALSE)
b <- gsheet2tbl(url)
xday<-b$Timestamp
z<-strptime(xday, "%m/%d/%Y %H:%M:%S")
#hist(z, breaks=10, freq = TRUE, main = "Timeline of QGIS Workshop Registration")
starttime<-strptime("9/18/2017 14:47", "%m/%d/%Y %H:%M")
#time in minutes from the first email being sent
fromstart<-z-starttime
hist(as.numeric(fromstart/60), breaks=15, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray", xlim=c(0,30))
url<-"https://docs.google.com/spreadsheets/d/1T__ll_KSmDmYkKb-KA-lPcxcsO5_bMUxZz38KmqnXPA/edit#gid=782537192"
a <- gsheet2text(url, format='tsv')
#b <- read.csv(a, stringsAsFactors=FALSE)
b <- gsheet2tbl(url)
xday<-b$Timestamp
z<-strptime(xday, "%m/%d/%Y %H:%M:%S")
#hist(z, breaks=10, freq = TRUE, main = "Timeline of QGIS Workshop Registration")
starttime<-strptime("9/18/2017 14:47", "%m/%d/%Y %H:%M")
#time in minutes from the first email being sent
fromstart<-z-starttime
hist(as.numeric(fromstart/60), breaks=15, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray", xlim=c(0,30))
url<-"https://docs.google.com/spreadsheets/d/1T__ll_KSmDmYkKb-KA-lPcxcsO5_bMUxZz38KmqnXPA/edit#gid=782537192"
a <- gsheet2text(url, format='tsv')
#b <- read.csv(a, stringsAsFactors=FALSE)
b <- gsheet2tbl(url)
xday<-b$Timestamp
z<-strptime(xday, "%m/%d/%Y %H:%M:%S")
#hist(z, breaks=10, freq = TRUE, main = "Timeline of QGIS Workshop Registration")
starttime<-strptime("9/18/2017 14:47", "%m/%d/%Y %H:%M")
#time in minutes from the first email being sent
fromstart<-z-starttime
hist(as.numeric(fromstart/60), breaks=15, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray", xlim=c(0,30))
url<-"https://docs.google.com/spreadsheets/d/1T__ll_KSmDmYkKb-KA-lPcxcsO5_bMUxZz38KmqnXPA/edit#gid=782537192"
a <- gsheet2text(url, format='tsv')
#b <- read.csv(a, stringsAsFactors=FALSE)
b <- gsheet2tbl(url)
xday<-b$Timestamp
z<-strptime(xday, "%m/%d/%Y %H:%M:%S")
#hist(z, breaks=10, freq = TRUE, main = "Timeline of QGIS Workshop Registration")
starttime<-strptime("9/18/2017 14:47", "%m/%d/%Y %H:%M")
#time in minutes from the first email being sent
fromstart<-z-starttime
hist(as.numeric(fromstart/60), breaks=15, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray", xlim=c(0,30))
hist(as.numeric(fromstart/60), breaks=15, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray", xlim=c(0,40))
library(gsheet)
url<-"https://docs.google.com/spreadsheets/d/10wawrYYpeNZfVJa8XuRL5nzn19cModh18n6Lawv0DgY/edit#gid=1344573470"
a <- gsheet2text(url, format='tsv')
#b <- read.csv(a, stringsAsFactors=FALSE)
b <- gsheet2tbl(url)
xday<-b$Timestamp
z<-strptime(xday, "%m/%d/%Y %H:%M:%S")
#hist(z, breaks=10, freq = TRUE, main = "Timeline of QGIS Workshop Registration")
starttime<-strptime("9/18/2017 14:47", "%m/%d/%Y %H:%M")
#time in minutes from the first email being sent
fromstart<-z-starttime
hist(as.numeric(fromstart/60), breaks=15, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray", xlim=c(0,40))
b<-read.csv("C:\\Users\\mmtobias\\Documents\\Presentations\\2017 Fall Workshop Series\\geospatial_subscribe.csv")
b<-read.csv("C:\\Users\\mmtobias\\Documents\\Presentations\\2017 Fall Workshop Series\\geospatial_subscribe.csv")
head(b)
xday<-b$Date
?strptime
z<-strptime(xday, %d %b %Y %H:%M:%S")
#starttime<-strptime("9/18/2017 14:47", "%m/%d/%Y %H:%M")
#time in minutes from the first email being sent
#fromstart<-z-starttime
hist(as.numeric(fromstart/60), breaks=15, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray", xlim=c(0,40))
z<-strptime(xday, "%d %b %Y %H:%M:%S")
hist(z, breaks=15, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray")
hist(z, breaks=26, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray")
13*4
hist(z, breaks=52, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray")
hist(z, breaks=52, freq = TRUE, main = "Subscriptions to Geospatial List by Week",
xlab="Time", ylab="Number of Subscriptions", col="gray")
?subset
b<-subset(b, Action = "subscribe")
head(b)
b<-read.csv("C:\\Users\\mmtobias\\Documents\\Presentations\\2017 Fall Workshop Series\\geospatial_subscribe.csv")
b<-subset(b, Action = "subscribe")
xday<-b$Date
z<-strptime(xday, "%d %b %Y %H:%M:%S")
#starttime<-strptime("9/18/2017 14:47", "%m/%d/%Y %H:%M")
#time in minutes from the first email being sent
#fromstart<-z-starttime
hist(z, breaks=52, freq = TRUE, main = "Subscriptions to Geospatial List by Week",
xlab="Time", ylab="Number of Subscriptions", col="gray")
hist(z, breaks=52, freq = TRUE, main = "Subscriptions to UC Davis Geospatial List by Week",
xlab="Time", ylab="Number of Subscriptions", col="gray")
hist(z, breaks=52, freq = TRUE, main = "Subscriptions to UC Davis Geospatial List by Week",
xlab="Time", ylab="Number of Subscriptions", col="lavender")
hist(z, breaks=52, freq = TRUE, main = "Subscriptions to UC Davis Geospatial List by Week",
xlab="Time", ylab="Number of Subscriptions", col="green")
hist(z, breaks=52, freq = TRUE, main = "Subscriptions to UC Davis Geospatial List by Week", xlab="Time", ylab="Number of Subscriptions", col="light green")
b<-read.csv("C:\\Users\\mmtobias\\Documents\\Presentations\\2017 Fall Workshop Series\\geospatial_subscribe.csv")
b<-subset(b, Action = "subscribe")
xday<-b$Date
z<-strptime(xday, "%d %b %Y %H:%M:%S")
#starttime<-strptime("9/18/2017 14:47", "%m/%d/%Y %H:%M")
#time in minutes from the first email being sent
#fromstart<-z-starttime
hist(z, breaks=52, freq = TRUE, main = "Subscriptions to UC Davis Geospatial List by Week", xlab="Time", ylab="Number of Subscriptions", col="light green")
b
b<-subset(b, Action != NULL)
b
b<-read.csv("C:\\Users\\mmtobias\\Documents\\Presentations\\2017 Fall Workshop Series\\geospatial_subscribe.csv")
b<-subset(b, Action = "subscribe")
b<-subset(b, Action != NA)
b
b<-read.csv("C:\\Users\\mmtobias\\Documents\\Presentations\\2017 Fall Workshop Series\\geospatial_subscribe.csv")
b<-subset(b, Action = "subscribe")
xday<-b$Date
z<-strptime(xday, "%d %b %Y %H:%M:%S")
#starttime<-strptime("9/18/2017 14:47", "%m/%d/%Y %H:%M")
#time in minutes from the first email being sent
#fromstart<-z-starttime
hist(z, breaks=52, freq = TRUE, main = "Subscriptions to UC Davis Geospatial List by Week", xlab="Time", ylab="Number of Subscriptions", col="light green")
b
b<-subset(b, b$Action = "subscribe")
b<-subset(b, b$Action == "subscribe")
b
b<-read.csv("C:\\Users\\mmtobias\\Documents\\Presentations\\2017 Fall Workshop Series\\geospatial_subscribe.csv")
b<-subset(b, b$Action == "subscribe")
xday<-b$Date
z<-strptime(xday, "%d %b %Y %H:%M:%S")
#starttime<-strptime("9/18/2017 14:47", "%m/%d/%Y %H:%M")
#time in minutes from the first email being sent
#fromstart<-z-starttime
hist(z, breaks=52, freq = TRUE, main = "Subscriptions to UC Davis Geospatial List by Week", xlab="Time", ylab="Number of Subscriptions", col="light green")
hist(z, breaks=52, freq = TRUE, main = "Subscriptions to UC Davis Geospatial List by Week", xlab="Time", ylab="Number of Subscriptions", col="gray")
library(gsheet)
url<-"https://docs.google.com/spreadsheets/d/1T__ll_KSmDmYkKb-KA-lPcxcsO5_bMUxZz38KmqnXPA/edit#gid=782537192"
a <- gsheet2text(url, format='tsv')
#b <- read.csv(a, stringsAsFactors=FALSE)
b <- gsheet2tbl(url)
xday<-b$Timestamp
z<-strptime(xday, "%m/%d/%Y %H:%M:%S")
#hist(z, breaks=10, freq = TRUE, main = "Timeline of QGIS Workshop Registration")
starttime<-strptime("9/18/2017 14:47", "%m/%d/%Y %H:%M")
#time in minutes from the first email being sent
fromstart<-z-starttime
hist(as.numeric(fromstart/60), breaks=15, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray", xlim=c(0,40))
hist(as.numeric(fromstart/60), breaks=15, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray", xlim=c(0,50))
hist(as.numeric(fromstart/60), breaks=15, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray", xlim=c(0,55))
hist(as.numeric(fromstart/60), breaks=20, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray", xlim=c(0,55))
library(gsheet)
url<-"https://docs.google.com/spreadsheets/d/1T__ll_KSmDmYkKb-KA-lPcxcsO5_bMUxZz38KmqnXPA/edit#gid=782537192"
a <- gsheet2text(url, format='tsv')
#b <- read.csv(a, stringsAsFactors=FALSE)
b <- gsheet2tbl(url)
xday<-b$Timestamp
z<-strptime(xday, "%m/%d/%Y %H:%M:%S")
#hist(z, breaks=10, freq = TRUE, main = "Timeline of QGIS Workshop Registration")
starttime<-strptime("9/18/2017 14:47", "%m/%d/%Y %H:%M")
#time in minutes from the first email being sent
fromstart<-z-starttime
hist(as.numeric(fromstart/60), breaks=20, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray", xlim=c(0,55))
hist(as.numeric(fromstart/60), breaks=20, freq = TRUE, main = "Timeline of QGIS Workshop Registration",
xlab="Time (hours) from Announcement Email (~3:00pm)", ylab="Number of Registrations", col="gray", xlim=c(0,60))
pdffiles<-list.files(path="C:\\Users\\mmtobias\\Documents\\MaiduMap\\AllotFilesTransfer10.2.17")
pdffiles
pdffiles<-list.files(path="C:\\Users\\mmtobias\\Documents\\MaiduMap\\AllotFilesTransfer10.2.17", pattern = "*.pdf")
pdffiles
? write.csv
write.csv(pdffiles, file = "C:\\Users\\mmtobias\\Documents\\MaiduMap\\FileList_2017-10-17.csv")
pdffiles<-list.files(path="C:\\Users\\mmtobias\\Documents\\MaiduMap\\AllotFilesTransfer8.4.17", pattern = "*.pdf")
write.csv(pdffiles, file = "C:\\Users\\mmtobias\\Documents\\MaiduMap\\FileList_2017-08-04.csv")
pdffiles<-list.files(path="C:\\Users\\mmtobias\\Documents\\MaiduMap\\New_Finished", pattern = "*.pdf")
write.csv(pdffiles, file = "C:\\Users\\mmtobias\\Documents\\MaiduMap\\NewFinished.csv")
pdffiles<-list.files(path="C:\\Users\\mmtobias\\Documents\\MaiduMap\\Outbox", pattern = "*.pdf")
write.csv(pdffiles, file = "C:\\Users\\mmtobias\\Documents\\MaiduMap\\FileList_Outbox.csv")
library(sp)
? splines()
? sp.lines
?SpatialLines
b<-read.csv("C:\\Users\\mmtobias\\Documents\\Presentations\\2017 Fall Workshop Series\\geospatial_subscribe.csv")
b<-subset(b, b$Action == "subscribe")
xday<-b$Date
z<-strptime(xday, "%d %b %Y %H:%M:%S")
#starttime<-strptime("9/18/2017 14:47", "%m/%d/%Y %H:%M")
#time in minutes from the first email being sent
#fromstart<-z-starttime
hist(z, breaks=52, freq = TRUE, main = "Subscriptions to UC Davis Geospatial List by Week", xlab="Time", ylab="Number of Subscriptions", col="gray")
install.packages(c('osmdata','sf'), dependencies = TRUE)
library(magrittr)
library(osmdata)
bb <- getbb('Davis')
q0 <- opq(bb)
q1 <- add_osm_feature(q0,key = 'amenity', value = 'bicycle_parking')
osmd <- osmdata_sf(q1)
osmd <- opq(bbox = 'Davis') %>%
add_osm_feature(key = 'amenity', value = 'bicycle_parking') %>%
osmdata_sf()
print(osmd)
library(mapview)
mapview(osmd$osm_polygons)
?geojson_read
? geojson_read
library(raster)
library(geojsonio)
library(rgdal)
? geojson_read
input<-"C:\Users\mmtobias\Documents\Presentations\DataViz\Flowlines.geojson"
input<-"C:\\Users\\mmtobias\\Documents\\Presentations\\DataViz\\Flowlines.geojson"
flowlines<-geojson_read(input, what = "sp")
head(flowlines)
flowlines[order(Length_Meters),]
flowlines@data$Length_Meters
flowlines[order(flowlines@data$Length_Meters),]
read.csv("C:\\Users\\mmtobias\\Documents\\Presentations\\Presentations_2018-01-11.csv")
present<-read.csv("C:\\Users\\mmtobias\\Documents\\Presentations\\Presentations_2018-01-11.csv")
barplot(present$Workshop, present$Date)
barplot(present$Workshop, present$Attendance)
? barplot
barplot(height=present$Attendance)
maptime<-subset(present, present$Purpose = "Workshop series")
? subset
subset
maptime<-subset(present, present$Purpose == "Workshop series")
barplot(height=maptime$Attendance)
maptime<-subset(present, present$Purpose == "Workshop series", names.arg=present$Workshop)
barplot(height=maptime$Attendance, names.arg=maptime$Workshop)
barplot(height=maptime$Attendance, names.arg=rownames(maptime))
length(maptime)
dim(maptime)
maptime$Workshop
maptime$week<-1:length(maptime$Workshop)
barplot(height=maptime$Attendance, names.arg=maptime$week)
?text
text(x=maptime$week, y= 0.5, labels=maptime$Workshop, pos=3)
text(x=maptime$week, y= 0.5, labels=maptime$Workshop, pos=3, srt = 90)
barplot(height=maptime$Attendance, names.arg=maptime$week)
text(x=maptime$week, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
text(x=maptime$week, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90, cex=2)
barplot(height=maptime$Attendance, names.arg=maptime$week)
text(x=maptime$week, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance")
text(x=maptime$week, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
present<-read.csv("C:\\Users\\mmtobias\\Documents\\Presentations\\Presentations_2018-01-11.csv")
maptime<-subset(present, present$Purpose == "Workshop series")
maptime$week<-c(0, 1, 2, 3, 4, 5, 6, 7, 9, 10)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance")
text(x=maptime$week, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(1, 2,2,2,2,2,2,2,2,2)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance")
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(.75, 2,2,2,2,2,2,2,2,2)
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 2,2,2,2,2,2,2,2,2)
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.5 ,2,2,2,2,2,2,2,2)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance")
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.75 ,2,2,2,2,2,2,2,2)
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.75 ,3 ,2,2,2,2,2,2,2)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance")
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.75, 2.8, 2,2,2,2,2,2,2)
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.75, 2.9, 2,2,2,2,2,2,2)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance")
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.75, 2.9, 4, 2, 2, 2, 2, 2, 2)
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.75, 2.9, 4.2, 2, 2, 2, 2, 2, 2)
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.75, 2.9, 4.1, 2, 2, 2, 2, 2, 2)
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.75, 2.9, 4.1, 5, 2, 2, 2, 2, 2)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance")
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.75, 2.9, 4.1, 5.4, 2, 2, 2, 2, 2)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance")
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.75, 2.9, 4.1, 5.3, 2, 2, 2, 2, 2)
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.75, 2.9, 4.1, 5.3, 7, 2, 2, 2, 2)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance")
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.75, 2.9, 4.1, 5.3, 6.5, 2, 2, 2, 2)
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.75, 2.9, 4.1, 5.3, 6.5, 7.4, 2, 2, 2)
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.75, 2.9, 4.1, 5.3, 6.5, 7.6, 2, 2, 2)
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.75, 2.9, 4.1, 5.3, 6.5, 7.7, 2, 2, 2)
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.75, 2.9, 4.1, 5.3, 6.5, 7.7, 8.5, 2, 2)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance")
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.75, 2.9, 4.1, 5.3, 6.5, 7.7, 9, 2, 2)
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.75, 2.9, 4.1, 5.3, 6.5, 7.7, 8.9, 2, 2)
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.75, 2.9, 4.1, 5.3, 6.5, 7.7, 8.9, 10, 2)
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.75, 2.9, 4.1, 5.3, 6.5, 7.7, 8.9, 10.1, 2)
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.75, 2.9, 4.1, 5.3, 6.5, 7.7, 8.9, 10.1, 11.3)
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
maptime$labelpos<-c(0.5, 1.75, 2.9, 4.1, 5.3, 6.5, 7.7, 8.9, 10.1, 11.3)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance")
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance", col="light gray")
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90)
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90, font=2)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance", col="light gray")
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90, font=2)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance", col="light gray")
grid(nx=NA, ny=NULL)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance", col="light gray")
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance", col="light gray")
grid(nx=NA, ny=NULL)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance", col="light gray", add=T)
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90, font=2)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance", col="light gray", yaxt=n)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance", col="light gray", yaxt='n')
grid(nx=NA, ny=NULL)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance", col="light gray", add=T, yaxt='n')
text(x=-1, y=c(10, 20, 30, 40, 50), labels=c(10, 20, 30, 40, 50))
text(x=1, y=c(10, 20, 30, 40, 50), labels=c(10, 20, 30, 40, 50))
text(x=0, y=c(10, 20, 30, 40, 50), labels=c(10, 20, 30, 40, 50))
text(x=-0.1, y=c(10, 20, 30, 40, 50), labels=c(10, 20, 30, 40, 50))
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance", col="light gray", yaxt='n', ylim=c(0, 51))
grid(nx=NA, ny=NULL)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance", col="light gray", yaxt='n', ylim=c(0, 51))
grid(nx=NA, ny=NULL)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance", col="light gray", add=T, yaxt='n', ylim=c(0, 51))
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90, font=2)
text(x=-0.1, y=c(10, 20, 30, 40, 50), labels=c(10, 20, 30, 40, 50))
text(x=-0.1, y=c(10, 20, 30, 40, 50), labels=c(10, 20, 30, 40, 50), cex = 0.5)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance", col="light gray", yaxt='n', ylim=c(0, 51))
grid(nx=NA, ny=NULL)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance", col="light gray", add=T, yaxt='n', ylim=c(0, 51))
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90, font=2)
text(x=-0.1, y=c(10, 20, 30, 40, 50), labels=c(10, 20, 30, 40, 50), cex = 0.75)
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90, font=2, cex = 0.75)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance", col="light gray", yaxt='n', ylim=c(0, 51))
grid(nx=NA, ny=NULL)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance", col="light gray", add=T, yaxt='n', ylim=c(0, 51))
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90, font=2, cex = 0.75)
text(x=-0.1, y=c(10, 20, 30, 40, 50), labels=c(10, 20, 30, 40, 50), cex = 0.75)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance", col="light gray", yaxt='n', ylim=c(0, 51))
grid(nx=NA, ny=NULL)
barplot(height=maptime$Attendance, names.arg=maptime$week, xlab = "Week", ylab="Attendance", main="#maptimeDavis Fall 2017 Attendance", col="light gray", add=T, yaxt='n', ylim=c(0, 51))
text(x=maptime$labelpos, y= 0.5, labels=maptime$Workshop, pos=4, srt = 90, font=1, cex = 0.75)
text(x=-0.1, y=c(10, 20, 30, 40, 50), labels=c(10, 20, 30, 40, 50), cex = 0.75)
install.packages(c("sf", "raster", "rgdal", "rasterVis"))
getwd()
setwd("C:\\Users\\mmtobias\\Documents\\Carpentries")
library(raster)
library(rgdal)
# Load raster into R
DSM_HARV <- raster("data/NEON-DS-Airborne-Remote-Sensing/HARV/DSM/HARV_dsmCrop.tif")
# View raster structure
DSM_HARV
# plot raster
# note \n in the title forces a line break in the title
plot(DSM_HARV, main = "NEON Digital Surface Model\nHarvard Forest")
?ggplot
? ggplot()
?ggplot()
str(DSM_HARV)
type(DSM_HARV)
class(DSM_HARV)
spplot(DSM_HARV)
install.packages("ggplot")
install.packages("ggplot2")
library(raster)
library(rgdal)
setwd("C:\\Users\\mmtobias\\Documents\\WineData\\Topos\\Yadkin")
topo<-raster("NC_Charlotte_164185_1953_250000_geo.tif")
crs(topo)
newcrs<-crs("+init=epsg:4326")
topo4326<-spTransform(topo, newcrs)
crs(topo4326)
topo4326<-projectRaster(topo, newcrs)
topo4326<-projectRaster(topo, crs=newcrs)
writeRaster(topo4326, 'Charlotte.tif', overwrite=TRUE)
crs(topo)
topo<-raster("NC_Winston-Salem_164064_1953_250000_geo.tif")
crs(topo)
setwd("C:\\Users\\mmtobias\\Documents\\GitHub\\ava")
# This R script combines all the GeoJSON files in a folder into one file, then writes it back to the folder.
# Modified from its original source: https://gist.github.com/wildintellect/582bb1096092170070996d21037b82d8
library(raster)
library(geojsonio)
library(rgdal)
# probably want to change the pattern to exclude or filter after to drop the all.geojson file
avas <- list.files(path="./avas", pattern = "*json$", full.names = "TRUE")
tbd <- list.files(path="./tbd", pattern = "*json$", full.names = "TRUE")
gj <- c(avas, tbd)
# exclude the all.geojson file... probably a more elegant way to do this, but this works:
gj <- gj[gj != "./avas.geojson"]
gj <- gj[gj != "./tbd/avas.geojson"]
#read all the geojson files
vects <- lapply(gj, geojson_read, what="sp")
#combine all the vectors together, bind is from the raster package
#probably could just rbind geojson lists too, but thats harder to plot
all <- do.call(bind, vects)
#Change any "N/A" data to nulls
all@data[all@data=="N/A"]<- NA
#Calculate area of polygons
#Example: x$area_sqkm <- area(x)
#all$area<-area(all)
#all@data$area <- sapply(slot(ploygons, "polygons"), function(i) slot(i, "area"))
all@data$area<-sapply(slot(all, "polygons"), function(i){slot(i, "area")})
#add the row names in a column
all$rows<-row.names(all)
#Order by area
#Example: meuse <- meuse[match(x[order(x$IDS),]$r, row.names(meuse@data)),]
#newdata <- mtcars[order(mpg, cyl),]
#all<-all[order(all$area),]
all<-all[match(all[order(all$area, decreasing = TRUE),]$rows, row.names(all@data)),]
#add new ID column
all$newid<-1:length(all)
#assign the new id to the ID field of each polygon
for (i in 1:nrow(all@data)){
all@polygons[[i]]@ID<-as.character(all$newid[i])}
#drop unneccessary columns
all@data<-all@data[,1:(ncol(all@data)-3)]
geojson_write(all, file="avas.geojson", overwrite=TRUE, convert_wgs84 = TRUE)