-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Rhistory
512 lines (512 loc) · 29.9 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
503
504
505
506
507
508
509
510
511
512
path.google <- "/Volumes/GoogleDrive/My Drive/"
path.dat <- file.path(dir.base, "Observing Lists/Tilia")
maps.out <- file.path(path.dat)
path.gis <- "/Volumes/GIS/Collections" # Note: could soft-code this in, but repeating it everywhere is making it easier to search
dir.create(path.dat, recursive = T, showWarnings = F)
# Species in the NPN database
npn <- c("americana", "cordata", "tomentosa",)
length(npn)
tilia<- read.csv(("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_v_1.csv"))
head(tilia)
# Removing for double entries
for(PLANT in unique(acer$PlantNumber)){
acer <- acer[c(which(acer$PlantNumber!=PLANT), which(acer$PlantNumber==PLANT)[1]), ]
}
tilia<- read.csv("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_v_1.csv")
head(tilia)
tilia<- read.csv("//Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_v_1.csv")
library(googlesheets)
library(raster); library(rgdal); library(rgeos) # spatial analysis packages
library(ggplot2); library(grid) # graphing packages
dir.base <- "/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/"
path.google <- "/Volumes/GoogleDrive/My Drive/"
path.dat <- file.path(dir.base, "Observing Lists/Tilia")
maps.out <- file.path(path.dat)
path.gis <- "/Volumes/GIS/Collections" # Note: could soft-code this in, but repeating it everywhere is making it easier to search
dir.create(path.dat, recursive = T, showWarnings = F)
# Species in the NPN database
npn <- c("americana", "cordata", "tomentosa",)
length(npn)
spp.keep <- c("amurensis", "dasystyla", "euchlora", "europaea", "flavescens", "japonica", "mandshurica","mongolica", "oliveri", "orbicularis","paucicostata","platyphyllos", "zamoyskiana")
tilia<- read.csv("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_v_1.csv")
library(googlesheets)
library(raster); library(rgdal); library(rgeos) # spatial analysis packages
library(ggplot2); library(grid) # graphing packages
path.google <- "/Volumes/GoogleDrive/My Drive/"
path.dat <- file.path(dir.base, "Observing Lists/Tilia")
maps.out <- file.path(path.dat)
path.gis <- "/Volumes/GIS/Collections" # Note: could soft-code this in, but repeating it everywhere is making it easier to search
dir.create(path.dat, recursive = T, showWarnings = F)
# Species in the NPN database
npn <- c("americana", "cordata", "tomentosa",)
length(npn)
spp.keep <- c("amurensis", "dasystyla", "euchlora", "europaea", "flavescens", "japonica", "mandshurica","mongolica", "oliveri", "orbicularis","paucicostata","platyphyllos", "zamoyskiana")
tilia<- read.csv("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_v_1.csv")
head(tilia)
library(googlesheets)
library(raster); library(rgdal); library(rgeos) # spatial analysis packages
library(ggplot2); library(grid) # graphing packages
dir.base <- "/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/"
setwd(dir.base)
path.google <- "/Volumes/GoogleDrive/My Drive/"
path.dat <- file.path(dir.base, "Observing Lists/Tilia")
maps.out <- file.path(path.dat)
path.gis <- "/Volumes/GIS/Collections" # Note: could soft-code this in, but repeating it everywhere is making it easier to search
dir.create(path.dat, recursive = T, showWarnings = F)
# Species in the NPN database
npn <- c("americana", "cordata", "tomentosa",)
# Species in the NPN database
npn <- c("americana", "cordata", "tomentosa")
length(npn)
spp.keep <- c("amurensis", "dasystyla", "euchlora", "europaea", "flavescens", "japonica", "mandshurica","mongolica", "oliveri", "orbicularis","paucicostata","platyphyllos", "zamoyskiana")
tilia<- read.csv("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_v_1.csv")
library(googlesheets)
library(raster); library(rgdal); library(rgeos) # spatial analysis packages
library(ggplot2); library(grid) # graphing packages
setwd(dir.base)
dir.base <- "/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/"
setwd(dir.base)
library(googlesheets)
library(raster); library(rgdal); library(rgeos) # spatial analysis packages
library(ggplot2); library(grid) # graphing packages
dir.base <- "/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/"
path.google <- "/Volumes/GoogleDrive/My Drive/"
path.dat <- file.path(dir.base, "Observing Lists/Tilia")
maps.out <- file.path(path.dat)
path.gis <- "/Volumes/GIS/Collections" # Note: could soft-code this in, but repeating it everywhere is making it easier to search
dir.create(path.dat, recursive = T, showWarnings = F)
# Species in the NPN database
npn <- c("americana", "cordata", "tomentosa")
length(npn)
spp.keep <- c("amurensis", "dasystyla", "euchlora", "europaea", "flavescens", "japonica", "mandshurica","mongolica", "oliveri", "orbicularis","paucicostata","platyphyllos", "zamoyskiana")
tilia<- read.csv("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_v_1.csv")
viewport()
View(dir.base)
tilia<- read.csv("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Acer/ObservingList_Acer.csv")
tilia<- read.csv("../Observing Lists/Acer/Tilia_v_1.csv")
library(googlesheets)
library(raster); library(rgdal); library(rgeos) # spatial analysis packages
library(ggplot2); library(grid) # graphing packages
setwd(dir.base)
dir.base <- "/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/"
View(acc.check)
library(googlesheets)
library(raster); library(rgdal); library(rgeos) # spatial analysis packages
library(ggplot2); library(grid) # graphing packages
dir.base <- "/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/"
path.google <- "/Volumes/GoogleDrive/My Drive/"
path.dat <- file.path(dir.base, "Observing Lists/Tilia")
maps.out <- file.path(path.dat)
path.gis <- "/Volumes/GIS/Collections" # Note: could soft-code this in, but repeating it everywhere is making it easier to search
dir.create(path.dat, recursive = T, showWarnings = F)
# Species in the NPN database
npn <- c("americana", "cordata", "tomentosa",)
length(npn)
spp.keep <- c("amurensis", "dasystyla", "euchlora", "europaea", "flavescens", "japonica", "mandshurica","mongolica", "oliveri", "orbicularis","paucicostata","platyphyllos", "zamoyskiana")
# Species in the NPN database
npn <- c("americana", "cordata", "tomentosa")
length(npn)
spp.keep <- c("amurensis", "dasystyla", "euchlora", "europaea", "flavescens", "japonica", "mandshurica","mongolica", "oliveri", "orbicularis","paucicostata","platyphyllos", "zamoyskiana")
tilia<- read.csv("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_v_1.csv")
tilia<- read.csv("//Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_v_1.csv")
tilia<- read_csv("//Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_v_1.csv")
traceback()
tilia<- read.csv("//Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_v_1.csv")
tilia<- read.csv("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_v_1.csv")
tilia<- read.csv("../Observing Lists/Tilia/Tilia_v_1.csv")
list.files(dir.base)
dir.base <- "/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/"
path.google <- "/Volumes/GoogleDrive/My Drive/"
path.dat <- file.path(dir.base, "Observing Lists/Tilia")
list.files(path.dat)
dir.base <- "/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/"
path.google <- "/Volumes/GoogleDrive/My Drive/"
path.dat <- file.path(dir.base, "Observing Lists/Tilia")
.maps.out <- file.path(path.dat)
path.gis <- "/Volumes/GIS/Collections" # Note: could soft-code this in, but repeating it everywhere is making it easier to search
dir.create(path.dat, recursive = T, showWarnings = F)
# Species in the NPN database
npn <- c("americana", "cordata", "tomentosa")
length(npn)
spp.keep <- c("amurensis", "dasystyla", "euchlora", "europaea", "flavescens", "japonica", "mandshurica","mongolica", "oliveri", "orbicularis","paucicostata","platyphyllos", "zamoyskiana")
tilia<- read.csv("../Observing Lists/Tilia/Tilia_v_1.csv")
summary(path.dat)
view(path.dat)
View(path.dat)
path.google <- "/Volumes/GoogleDrive/My Drive/"
path.dat <- file.path(dir.base, "/Observing Lists/Tilia")
.maps.out <- file.path(path.dat)
path.gis <- "/Volumes/GIS/Collections" # Note: could soft-code this in, but repeating it everywhere is making it easier to search
dir.create(path.dat, recursive = T, showWarnings = F)
# Species in the NPN database
npn <- c("americana", "cordata", "tomentosa")
length(npn)
spp.keep <- c("amurensis", "dasystyla", "euchlora", "europaea", "flavescens", "japonica", "mandshurica","mongolica", "oliveri", "orbicularis","paucicostata","platyphyllos", "zamoyskiana")
tilia<- read.csv("../Observing Lists/Tilia/Tilia_v_1.csv")
head(tilia)
tilia<- read.csv("../Observing Lists/Tilia/Tilia_v_1.csv")
file.path("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia")
file.path("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia")
path.google <- "/Volumes/GoogleDrive/My Drive/"
path.dat <- file.path
.maps.out <- file.path(path.dat)
#maps.out <- file.path(path.dat)
path.gis <- "/Volumes/GIS/Collections" # Note: could soft-code this in, but repeating it everywhere is making it easier to search
dir.create(path.dat, recursive = T, showWarnings = F)
file.path("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/")
path.google <- "/Volumes/GoogleDrive/My Drive/"
path.dat <- file.path(dir.base, "Observing Lists/Tilia")
.maps.out <- file.path(path.dat)
path.gis <- "/Volumes/GIS/Collections" # Note: could soft-code this in, but repeating it everywhere is making it easier to search
dir.create(path.dat, recursive = T, showWarnings = F)
Species in the NPN database
npn <- c("americana", "cordata", "tomentosa")
length(npn)
#Species in the NPN database
npn <- c("americana", "cordata", "tomentosa")
length(npn)
spp.keep <- c("amurensis", "dasystyla", "euchlora", "europaea", "flavescens", "japonica", "mandshurica","mongolica", "oliveri", "orbicularis","paucicostata","platyphyllos", "zamoyskiana")
tilia<- read.csv("../Observing Lists/Tilia/Tilia_v_1.csv")
tilia<- read.csv("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology//Observing Lists/Tilia/Tilia_v_1.csv")
tilia<- read.csv("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_v_1.csv")
library(googlesheets)
library(raster); library(rgdal); library(rgeos) # spatial analysis packages
library(ggplot2); library(grid) # graphing packages
dir.base <- "/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/"
path.dat <- file.path(dir.base, "Observing Lists/Ulmus")
maps.out <- file.path(path.dat)
path.gis <- "/Volumes/GIS/Collections" # Note: could soft-code this in, but repeating it everywhere is making it easier to search
dir.create(path.dat, recursive = T, showWarnings = F)
# Species in the NPN database
npn <- c("americana", "crassifolia", "pumila", "rubra", "alata")
length(npn)
# Species requested from Kim Shearer:
kim <- c("crassifolia", "parvifolia", "thomasii", "minor", "parvifolia", "minor x parvifolia")
# Querying the googlesheet for missing trees up front to make it easier
sheet.gone <- gs_title("Removed Trees - Phenology_LivingCollections")
# Querying the googlesheet for missing trees up front to make it easier
sheet.gone <- gs_title("Removed Trees - Phenology_LivingCollections")
sheet.gone # Prints all the metadata
# Get the particular sheet & coerce it into a data frame rather than something special
df.gone <- data.frame(gs_read(sheet.gone, ws="Removed Trees"))
summary(df.gone)
# ----------------------------
# Narrowing down the phenology observering lists
# ----------------------------
ulmus <- read.csv("../data/collections/Ulmus_2019-10-14_212755276-BRAHMSOnlineData.csv")
View(ulmus)
tilia<- read.csv("../data/Tilia_v_1.csv")
tilia<- read.csv("../Tilia_v_1.csv")
library(raster); library(rgdal); library(rgeos) # spatial analysis packages
library(ggplot2); library(grid) # graphing packages
dir.base <- "/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/"
path.dat <- file.path(dir.base, "Observing Lists/Tilia")
.maps.out <- file.path(path.dat)
path.gis <- "/Volumes/GIS/Collections" # Note: could soft-code this in, but repeating it everywhere is making it easier to search
dir.create(path.dat, recursive = T, showWarnings = F)
# Species in the NPN database
npn <- c("americana", "cordata", "tomentosa")
length(npn)
spp.keep <- c("amurensis", "dasystyla", "euchlora", "europaea", "flavescens", "japonica", "mandshurica","mongolica", "oliveri", "orbicularis","paucicostata","platyphyllos", "zamoyskiana")
tilia<- read.csv("../Tilia_v_1.csv")
tilia<- read.csv("./Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/ObservingList/Tilia/Tilia_v_1.csv")
tilia<- read.csv("./Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/ObservingLists/Tilia/Tilia_v_1.csv")
tilia<- read.csv("./Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_v_1.csv")
tilia<- read.csv("./Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_1.csv")
library(raster); library(rgdal); library(rgeos) # spatial analysis packages
library(ggplot2); library(grid) # graphing packages
dir.base <- "/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/"
path.dat <- file.path(dir.base, "Observing Lists/Tilia")
.maps.out <- file.path(path.dat)
path.gis <- "/Volumes/GIS/Collections" # Note: could soft-code this in, but repeating it everywhere is making it easier to search
dir.create(path.dat, recursive = T, showWarnings = F)
# Species in the NPN database
npn <- c("americana", "cordata", "tomentosa")
length(npn)
spp.keep <- c("amurensis", "dasystyla", "euchlora", "europaea", "flavescens", "japonica", "mandshurica","mongolica", "oliveri", "orbicularis","paucicostata","platyphyllos", "zamoyskiana")
tilia<- read.csv("./Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_1.csv")
tilia<- read.csv("./Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_1")
tilia<- read.csv("./Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/")
tilia<- read.csv("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/")
tilia<- read.csv("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_1.csv")
library(ggplot2); library(grid);library(googlesheets4) # graphing packages
library(ggplot2); library(grid);library(googlesheets4) # graphing packages
tilia<- read_csv("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_1.csv")
tilia<- read_sheet("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_all")
rlang::last_error()
tilia<- read.csv("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_1.csv")
dir.base <- "/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/"
path.dat <- file.path(dir.base, "Observing Lists/Tilia")
.maps.out <- file.path(path.dat)
# Species in the NPN database
npn <- c("americana", "cordata", "tomentosa")
length(npn)
spp.keep <- c("amurensis", "dasystyla", "euchlora", "europaea", "flavescens", "japonica", "mandshurica","mongolica", "oliveri", "orbicularis","paucicostata","platyphyllos", "zamoyskiana")
tilia<- read.csv("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_1.csv")
tilia<- read_sheet("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_all")
library(raster); library(rgdal); library(rgeos) # spatial analysis packages
library(ggplot2); library(grid);library(googlesheets4) # graphing packages
dir.base <- "/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/"
path.dat <- file.path(dir.base, "Observing Lists/Tilia")
.maps.out <- file.path(path.dat)
#path.gis <- "/Volumes/GIS/Collections" # Note: could soft-code this in, but repeating it everywhere is making it easier to search
dir.create(path.dat, recursive = T, showWarnings = F)
# Species in the NPN database
npn <- c("americana", "cordata", "tomentosa")
length(npn)
spp.keep <- c("amurensis", "dasystyla", "euchlora", "europaea", "flavescens", "japonica", "mandshurica","mongolica", "oliveri", "orbicularis","paucicostata","platyphyllos", "zamoyskiana")
tilia<- read.csv("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_1.csv")
tilia<- read_sheet("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_all")
library(raster); library(rgdal); library(rgeos) # spatial analysis packages
library(ggplot2); library(grid);library(googlesheets4) # graphing packages
dir.base <- "/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/"
path.dat <- file.path(dir.base, "Observing Lists/Tilia")
.maps.out <- file.path(path.dat)
path.gis <- "/Volumes/GIS/Collections" # Note: could soft-code this in, but repeating it everywhere is making it easier to search
dir.create(path.dat, recursive = T, showWarnings = F)
# Species in the NPN database
npn <- c("americana", "cordata", "tomentosa")
length(npn)
spp.keep <- c("amurensis", "dasystyla", "euchlora", "europaea", "flavescens", "japonica", "mandshurica","mongolica", "oliveri", "orbicularis","paucicostata","platyphyllos", "zamoyskiana")
#################I don't think I need this because there are no missing Tilia, and I have alreay subset out the Tilia we will be observing
# Querying the googlesheet for missing trees up front to make it easier
sheet.gone <- gs_title("Removed Trees - Phenology_LivingCollections")
sheet.gone # Prints all the metadata
# Get the particular sheet & coerce it into a data frame rather than something special
df.gone <- data.frame(gs_read(sheet.gone, ws="Removed Trees"))
#################I don't think I need this because there are no missing Tilia, and I have alreay subset out the Tilia we will be observing
# Querying the googlesheet for missing trees up front to make it easier
sheet.gone <- gs_title("Removed Trees - Phenology_LivingCollections")
library(googlesheets)
library(raster); library(rgdal); library(rgeos) # spatial analysis packages
library(ggplot2); library(grid) # graphing packages
dir.base <- "/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/"
path.dat <- file.path(dir.base, "Observing Lists/Ulmus")
maps.out <- file.path(path.dat)
path.gis <- "/Volumes/GIS/Collections" # Note: could soft-code this in, but repeating it everywhere is making it easier to search
dir.create(path.dat, recursive = T, showWarnings = F)
# Species in the NPN database
npn <- c("americana", "crassifolia", "pumila", "rubra", "alata")
length(npn)
# Species requested from Kim Shearer:
kim <- c("crassifolia", "parvifolia", "thomasii", "minor", "parvifolia", "minor x parvifolia")
# Querying the googlesheet for missing trees up front to make it easier
sheet.gone <- gs_title("Removed Trees - Phenology_LivingCollections")
sheet.gone # Prints all the metadata
# Get the particular sheet & coerce it into a data frame rather than something special
df.gone <- data.frame(gs_read(sheet.gone, ws="Removed Trees"))
summary(df.gone)
tilia<- read.csv("/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists/Tilia/Tilia_1.csv")
# ----------------------------
# Narrowing down the phenology observering lists
# ----------------------------
acer <- read.csv("../data/collections/Tilia_1.csv")
# ----------------------------
# Narrowing down the phenology observering lists
# ----------------------------
acer <- read.csv("../data/collections/Acer_2019-03-12_190650301-BRAHMSOnlineData.csv")
get
get(wd)
getwd
getwd()
setwd()
getwd()
file.choose()
#dat.gone1 <- subset(dat.gone, select = c(PlantNumber))
dat.fuckit <-dat.all(dat.all$PlantNumber !=df.gone$PlantNumber,)
library(ggplot2); library(grid);library (tidyr);library(googlesheets);
library(dplyr); library(readbulk); library(googlesheets4)
#Making sure the working directory in is google drive.
setwd("~/Google Drive/My Drive/LivingCollections_Phenology")
dir.base <- "Google Drive/My Drive/LivingCollections_Phenology"
path.dat <- file.path(dir.base, "Observing Lists")
path.gone <- file.path(dir.base, "Data_Observations")
path.out <- "Google Drive/My Drive/LivingCollections_Phenology/Observing Lists"
#Loading tree lists and place in data frame dat.all
dat.all <- read_bulk(directory = "../LivingCollections_Phenology/Observing Lists/Quercus", extension = ".csv", header=FALSE,)
head(dat.all)
colnames(dat.all)<- c("Obs.List", "PlantNumber", "Taxon", "Vernacular","BgLatitude", "BgLongitude","GardenGrid", "GardenSubGrid", "File")
summary(dat.all)
head(dat.all)
dat.gone <- read_sheet("https://docs.google.com/spreadsheets/d/16xMa6MyJlh3zKkELrDToyoPk_GfoN1NSCVji_ttOCoQ/edit#gid=0")
dat.gone <- read_sheet("https://docs.google.com/spreadsheets/d/16xMa6MyJlh3zKkELrDToyoPk_GfoN1NSCVji_ttOCoQ/edit#gid=0")
df.gone <-data.frame(dat.gone, header=FALSE)
head(df.gone)
#dat.gone1 <- subset(dat.gone, select = c(PlantNumber))
dat.fuckit <-dat.all(dat.all$PlantNumber !=df.gone$PlantNumber,)
summary(dat.all)
#dat.gone1 <- subset(dat.gone, select = c(PlantNumber))
dat.fuckit <-dat.all(dat.all$PlantNumber !=df.gone$PlantNumber,)
summary(dat.all)
head(dat.all)
#dat.gone1 <- subset(dat.gone, select = c(PlantNumber))
dat.fuckit <-dat.all(dat.all$PlantNumber !=df.gone$PlantNumber,)
#dat.gone1 <- subset(dat.gone, select = c(PlantNumber))
dat.all(dat.all$PlantNumber !=df.gone$PlantNumber,)
#dat.gone1 <- subset(dat.gone, select = c(PlantNumber))
dat.all(dat.all$PlantNumber & !=df.gone$PlantNumber,)
#dat.gone1 <- subset(dat.gone, select = c(PlantNumber))
dat.fuckit <- subset(!dat.all, df.gone$PlantNumber)
#dat.gone1 <- subset(dat.gone, select = c(PlantNumber))
dat.fuckit <- subset(!dat.all, df.gone$PlantNumber)
#dat.gone1 <- subset(dat.gone, select = c(PlantNumber))
dat.fuckit <- subset(dat.all, df.gone$PlantNumber)
#dat.gone1 <- subset(dat.gone, select = c(PlantNumber))
dat.fuckit <- subset(dat.all, !df.gone$PlantNumber)
#dat.gone1 <- subset(dat.gone, select = c(PlantNumber))
dat.fuckit <- subset(dat.all, dat.all$PlantNumber !=df.gone$PlantNumber)
anti_join(dat.all, df.gone, by=("PlantNumber"))
new.dat <- anti_join(dat.all, df.gone, by=("PlantNumber"))
View(new.dat)
View(dat.all)
summary(new.dat)
#Writing out new .csv files for the updated observation lists
sapply(unique(new.dat$Obs.List), function(x)
write.csv(new.dat[new.dat$Obs.List==x,],paste0("~/Desktop/R junk",x,".csv"),row.names=FALSE))
summary(new.dat)
# Split dataframe by obs.list
split_new.dat <- split(new.dat, list(new.dat$Obs.List))
# Writing out new .csv files for the updated observation lists
for (Obs.List in names(split_new.dat)) {
write.csv(split_new.dat[["Obs.List"]], paste0("~/Desktop/R junk",Obs.List, ".csv"), row.names=FALSE)
}
# Split dataframe by obs.list
split_new.dat <- split(new.dat, list(new.dat$Obs.List))
# Writing out new .csv files for the updated observation lists
for (Obs.List in names(split_new.dat)) {
write.csv(split_new.dat[["Obs.List"]], paste0("~/Desktop/R junk",Obs.List, ".csv"), row.names=FALSE)
}
# Writing out new .csv files for the updated observation lists
for (Obs.List in names(split_new.dat)) {
write.csv(split_new.dat[["Obs.List"]], paste0("/Desktop/R junk",Obs.List, ".csv"), row.names=FALSE)
}
# Writing out new .csv files for the updated observation lists
for (Obs.List in names(split_new.dat)) {
write.csv(split_new.dat[["Obs.List"]], paste0("~/Desktop/R junk", Obs.List, ".csv"), row.names=FALSE)
}
# Writing out new .csv files for the updated observation lists
for (Obs.List in names(split_new.dat)) {
write.csv(split_new.dat[["Obs.List"]], paste0("~/Desktop/R junk", Obs.List, ".csv"),)
}
# Split dataframe by obs.list
split_new.dat <- split(new.dat, list(new.dat$Obs.List))
View(split_new.dat)
new.dat <- new.dat[!grepl(new.dat$Obs.List,"Obs.List"), header= TRUE]
new.dat <- new.dat[!grepl(new.dat$Obs.List,"Obs.List")]
head(new.dat)
#Joinging two data frames with anti_join, to remove all the values for PlantNumber that match between dat.all and df.gone
new.dat <- anti_join(dat.all, df.gone, by=("PlantNumber"))
summary(new.dat)
head(new.dat)
# Split dataframe by obs.list
split_new.dat <- split(new.dat, list(new.dat$File))
# Split dataframe by obs.list
split_new.dat <- split(new.dat, list(new.dat$File))
# Writing out new .csv files for the updated observation lists
for (File in names(split_new.dat)) {
write.csv(split_new.dat[["File"]], paste0("~/Desktop/R junk", File, ".csv"),)
}
#Joinging two data frames with anti_join, to remove all the values for PlantNumber that match between dat.all and df.gone
new.dat <- anti_join(dat.all, df.gone, by=("PlantNumber"))
summary(new.dat)
head(new.dat)
View(new.dat)
#Renaming colums to make things a little easier
colnames(new.dat)<- c("Obs.List", "PlantNumber", "Taxon", "Vernacular","BgLatitude", "BgLongitude","GardenGrid", "GardenSubGrid", "Spacer")
head(new.dat)
# Split dataframe by obs.list
split_new.dat <- split(new.dat, list(new.dat$Spacer))
# Writing out new .csv files for the updated observation lists
for (Spacer in names(split_new.dat)) {
write.csv(split_new.dat[["Spacer"]], paste0("~/Desktop/R junk", Spacer, ".csv"),)
}
View(split_new.dat)
# Split dataframe by obs.list
split_new.dat <- split(new.dat, list(new.dat$Spacer))
# Writing out new .csv files for the updated observation lists
for (Spacer in names(split_new.dat)) {
write.csv(split_new.dat[[Spacer]], paste0("~/Desktop/R junk/", Spacer, ".csv"),)
}
library (tidyr); library(dplyr); library(readbulk); library(googlesheets4)
#Making sure the working directory in is google drive.
setwd("~/Google Drive/My Drive/LivingCollections_Phenology")
dir.base <- "Google Drive/My Drive/LivingCollections_Phenology"
path.out <- "Google Drive/My Drive/LivingCollections_Phenology/Observing Lists/Quercus"
#Batch loading trees from the Quercus tree observation lists and placing them in data frame dat.all
dat.all <- read_bulk(directory = "../LivingCollections_Phenology/Observing Lists/Quercus", extension = ".csv", header=FALSE,)
head(dat.all)
#Up dating col name from V1, V2, etc to reflect the information in those columns
colnames(dat.all)<- c("Obs.List", "PlantNumber", "Taxon", "Vernacular","BgLatitude", "BgLongitude","GardenGrid", "GardenSubGrid", "Spacer")
summary(dat.all)
head(dat.all)
#Loading the Removed trees google sheet and placing it in a data frame
dat.gone <- read_sheet("https://docs.google.com/spreadsheets/d/16xMa6MyJlh3zKkELrDToyoPk_GfoN1NSCVji_ttOCoQ/edit#gid=0")
df.gone <-data.frame(dat.gone, header=FALSE)
head(df.gone)
#Joinging two data frames with anti_join, to remove all the values for PlantNumber that match
#between dat.all and df.gone and placing them in the new data frame new.dat
new.dat <- anti_join(dat.all, df.gone, by=("PlantNumber"))
summary(new.dat)
View(new.dat)
View(dat.all)
path.out <- "Google Drive/My Drive/LivingCollections_Phenology/Observing Lists/Quercus"
#Batch loading trees from the Quercus tree observation lists and placing them in data frame dat.all
dat.all <- read_bulk(directory = "../LivingCollections_Phenology/Observing Lists/Quercus", extension = ".csv", header=FALSE,)
head(dat.all)
#Up dating col name from V1, V2, etc to reflect the information in those columns
colnames(dat.all)<- c("Obs.List", "PlantNumber", "Taxon", "Vernacular","BgLatitude", "BgLongitude","GardenGrid", "GardenSubGrid", "Spacer")
summary(dat.all)
head(dat.all)
#Loading the Removed trees google sheet and placing it in a data frame
dat.gone <- read_sheet("https://docs.google.com/spreadsheets/d/16xMa6MyJlh3zKkELrDToyoPk_GfoN1NSCVji_ttOCoQ/edit#gid=0")
df.gone <-data.frame(dat.gone, header=FALSE)
head(df.gone)
#Joinging two data frames with anti_join, to remove all the values for PlantNumber that match
#between dat.all and df.gone and placing them in the new data frame new.dat
new.dat <- anti_join(dat.all, df.gone, by=("PlantNumber"))
summary(new.dat)
# Splitting the new.dat dataframe by names in the the "Spacer" column, splits the data into
# the updated observations lists, and the list containing all oaks.
split_new.dat <- split(new.dat, list(new.dat$Spacer))
for (Spacer in names(split_new.dat)) {
write.csv(split_new.dat[[Spacer]], paste0("~/Desktop/R junk/", Spacer, ".csv"),)
}
library(raster); library(rgdal); library(rgeos) # spatial analysis packages
library(ggplot2); library(grid);# graphing packages
dir.base <- "/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/"
path.dat <- file.path(dir.base, "Observing Lists")
path.out <- "Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists"
.maps.out <- file.path(path.dat)
path.gis <- "/Volumes/GIS/Collections" # Note: could soft-code this in, but repeating it everywhere is making it easier to search
dir.create(path.dat, recursive = T, showWarnings = F)
# Species in the NPN database
npn <- c("americana", "cordata", "tomentosa")
length(npn)
spp.keep <- c("amurensis", "dasystyla", "euchlora", "europaea", "flavescens", "japonica", "mandshurica","mongolica", "oliveri", "orbicularis","paucicostata","platyphyllos", "zamoyskiana")
# ----------------------------
# Narrowing down the phenology observering lists
# ----------------------------
tilia <- read.csv("../data/ObservingLists/Tilia_v_1.csv")
# ----------------------------
# Narrowing down the phenology observering lists
# ----------------------------
tilia <- read.csv("../data/ObservingLists/Tilia_v_1.csv")
setwd("~/Documents/GitHub/Phenology_LivingCollections")
library(raster); library(rgdal); library(rgeos) # spatial analysis packages
library(ggplot2); library(grid);# graphing packages
dir.base <- "/Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/"
path.dat <- file.path(dir.base, "Observing Lists")
path.out <- "Volumes/GoogleDrive/My Drive/LivingCollections_Phenology/Observing Lists"
.maps.out <- file.path(path.dat)
path.gis <- "/Volumes/GIS/Collections" # Note: could soft-code this in, but repeating it everywhere is making it easier to search
dir.create(path.dat, recursive = T, showWarnings = F)
# Species in the NPN database
npn <- c("americana", "cordata", "tomentosa")
length(npn)
spp.keep <- c("amurensis", "dasystyla", "euchlora", "europaea", "flavescens", "japonica", "mandshurica","mongolica", "oliveri", "orbicularis","paucicostata","platyphyllos", "zamoyskiana")
# ----------------------------
# Narrowing down the phenology observering lists
# ----------------------------
tilia <- read.csv("../data/ObservingLists/Tilia_v_1.csv")
getwd
getwd()