-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdd_event.R
449 lines (393 loc) · 13.6 KB
/
dd_event.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
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
event<-
list(
data.frame(
Variable="EventID",
Label="Event Identifier",
Definition="System-provided Event identifier",
Type="Integer",
Mandatory="System-assigned"),
data.frame(
Variable="EventCode",
Label="Event Code",
Definition="User-provided Event code",
Type="String",
Mandatory="Yes"),
data.frame(
Variable="EventCrossReferenceID",
Label="Event Cross Identifier",
Definition="The identifier of an Event in another system (e.g., database/document/other)",
Type="String",
Mandatory="No"),
data.frame(
Variable="EventCrossReferenceIDOrigin",
Label="Event Cross Identifier Origin",
Definition="The database/document/other where other identification
for the same Event is used",
Type="String",
Mandatory="No"),
data.frame(
Variable="EventType",
Label="Event type",
Definition="The type of Event recorded",
Type="Single selection",
Mandatory="Yes"),
# data.frame(
# Variable="EventUnit",
# Label="Event unit",
# Definition="Explanation of what the Event represents (e.g., a field finding,
# a market, a vendor, a cage, a grid cell, a point in a transect, a mist net,
# a point in a parcel, a point in a protected area, etc.)",
# Type="Single selection",
# Mandatory="Yes"),
data.frame(
Variable="EventFeatures",
Label="Event Features",
Definition="Specific set of findings at the Event that are dynamic over time
(e.g., fire, smoke, etc)",
Type="Multiple selection",
Mandatory="Yes"),
data.frame(
Variable="EventOtherFeatures",
Label="Other Event Features",
Definition="Other findings at the Event that are dynamic over time not listed in the previous attribute",
Type="String",
Mandatory="No"),
# data.frame(
# Variable="EventBy",
# Label="Event Recorded by",
# Definition="The person that recorded the Event",
# Type="Single selection",
# Mandatory="Yes"),
data.frame(
Variable="EventBySector",
Label="Sector of the Reporter",
Definition="The sector of the person that reported the Event",
Type="Single selection",
Mandatory="No"),
data.frame(
Variable="EventDate",
Label="Event Date",
Definition="The date and time of the Event",
Type="String",
Mandatory="Yes"),
data.frame(
Variable="EventCoordinatesSource",
Label="The Source of the Coordinates Data",
Definition="The source of the coordinates (longitude and latitude) of the Event",
Type="Single selection",
Mandatory="Yes"),
data.frame(
Variable="EventCoordinateSystem",
Label="Event Coordindate System",
Definition="The coordinate system of the Event longitude and latitude reported",
Type="Single selection",
Mandatory="Yes"),
data.frame(
Variable="EventLongitude",
Label="Event Longitude",
Definition="Longitude coordinate in decimal degrees",
Type="Float",
Mandatory="Yes"),
data.frame(
Variable="EventLatitude",
Label="Event Latitude",
Definition="Latitude coordinate in decimal degrees",
Type="Float",
Mandatory="Yes"),
data.frame(
Variable="EventUTMZone",
Label="Event UTM Zone",
Definition="UTM Zone where the Event occurs. It applies if the longitude an latitude odf
the Event are provided in UTM coordinate reference system.
See https://www.dmap.co.uk/utmworld.htm",
Type="Single selection",
Mandatory="Yes"),
data.frame(
Variable="EventUTMEasting",
Label="Event UTM Easting",
Definition="UTM Easting value where the Event occurs",
Type="Float",
Mandatory="Yes"),
data.frame(
Variable="EventUTMNorthing",
Label="Event UTM Northing",
Definition="UTM Northing value where the Event occurs",
Type="Float",
Mandatory="Yes"),
data.frame(
Variable="EventDMSLongitudeDegrees",
Label="Event Longitude Degrees",
Definition="The degree value of the longitude coordinate (absolute value)",
Type="Integer",
Mandatory="Yes"),
data.frame(
Variable="EventDMSLongitudeMinutes",
Label="Event Longitude Minutes",
Definition="The minutes value of the longitude coordinate",
Type="Integer",
Mandatory="Yes"),
data.frame(
Variable="EventDMSLongitudeSeconds",
Label="Event Longitude Seconds",
Definition="The seconds value of the longitude coordinate",
Type="Float",
Mandatory="Yes"),
data.frame(
Variable="EventDMSLongitudeHemisphere",
Label="Event Longitude Hemisphere",
Definition="The eastern or western hemisphere where the Event occurs",
Type="Single selection",
Mandatory="Yes"),
data.frame(
Variable="EventDMSLatitudeDegrees",
Label="Event Latitude Degrees",
Definition="The degree value of the latitude coordinate (absolute value)",
Type="Integer",
Mandatory="Yes"),
data.frame(
Variable="EventDMSLatitudeMinutes",
Label="Event Latitude Minutes",
Definition="The minutes value of the latitude coordinate",
Type="Integer",
Mandatory="Yes"),
data.frame(
Variable="EventDMSLatitudeSeconds",
Label="Event Latitude Seconds",
Definition="The seconds value of the latitude coordinate",
Type="Float",
Mandatory="Yes"),
data.frame(
Variable="EventDMSLatitudeHemisphere",
Label="Event Latitude Hemisphere",
Definition="The northern or southern hemisphere where the Event occurs",
Type="Single selection",
Mandatory="Yes"),
# data.frame(
# Variable="EventUTMHemisphere",
# Label="Event UTM Hemisphere",
# Definition="UTM Zone where the Event occurs. It applies if the longitude an latitude odf
# the Event are provided in UTM coordinate reference system.
# See https://www.dmap.co.uk/utmworld.htm",
# Type="Single selection",
# Mandatory="Yes"),
data.frame(
Variable="EventCountry",
Label="Event Country",
Definition="Country where the Event occurs",
Type="Single selection",
Mandatory="Yes"),
data.frame(
Variable="EventStateProvince",
Label="Event State Or Province",
Definition="State or Province where the Event occurs",
Type="Single selection",
Mandatory="No"),
data.frame(
Variable="EventCounty",
Label="Event County",
Definition="County where the Event occurs",
Type="String",
Mandatory="No"),
data.frame(
Variable="EventComments",
Label="Event Comments",
Definition="Any other comments regarding the Event",
Type="String",
Mandatory="No"))
# data.frame(
# Variable="EventTargetedRecords",
# Label="Event Targeted Records",
# Definition="Indicate what type of Records (Group, Animal, Environmental,
# or from Arthropod Sources) are targeted in the Event",
# Type="Multiple selection",
# Mandatory="Yes"),
# --- if Group Source is selected
# --- if Animal Source is selected
# --- if Environmental Source is selected
# data.frame(
# Variable="EventTargetedTaxa",
# Label="Event Targeted Taxa",
# Definition="Indicate the taxa targeted in the Event. ",
# Type="Multiple selection",
# Mandatory="Yes"),
# data.frame(
# Variable="EventContainsRecords",
# Label="Event Contain Records",
# Definition="Indicate if Records of Group, Animal, Environmental, or Arthropod Sources
# are included in the Event",
# Type="Boolean",
# Mandatory="Yes"),
# data.frame(
# Variable="EventContainsSpecimens",
# Label="Event Contain Records",
# Definition="Indicate if Specimens of Group, Animal, Environmental, or Arthropod Sources
# Records are included in the Event",
# Type="Boolean",
# Mandatory="Yes"),
# data.frame(
# Variable="EventTypeOfRecords",
# Label="Event Type Of Records",
# Definition="Indicate the type of Records documented from the Event",
# Type="Boolean",
# Mandatory="Yes"),
# data.frame(
# Variable="EventSmartSource",
# Label="Event from SMART",
# Definition="Answer to the question: 'Was the Event recorded using SMART?'",
# Type="Single selection",
# Mandatory="No"),
#
#
# data.frame(
# Variable="EventSiteCode",
# Label="Site code",
# Definition="The site the Events are grouped by site",
# Type="Single selection",
# Mandatory="No"),
#
# data.frame(
# Variable="EventZoneCode",
# Label="Zone code",
# Definition="The zone the Events are grouped by zone",
# Type="Single selection",
# Mandatory="No"),
#
# data.frame(
# Variable="EventMarketCode",
# Label="Market code",
# Definition="The market the Events are grouped by market",
# Type="Single selection",
# Mandatory="No"),
#
# data.frame(
# Variable="EventGridCode",
# Label="Grid code",
# Definition="The grid code the when Events are grouped by grid",
# Type="Single selection",
# Mandatory="No"),
#
# data.frame(
# Variable="EventGridCellCode",
# Label="Grid cell code",
# Definition="The grid cell code when Events are grouped by grid cell",
# Type="Single selection",
# Mandatory="No"),
#
# data.frame(
# Variable="EventStationCode",
# Label="Station code",
# Definition="The station code when Events are grouped by station",
# Type="Single selection",
# Mandatory="No"),
#
# data.frame(
# Variable="EventTransectCode",
# Label="Transect code",
# Definition="The transect code when Events are grouped by transect",
# Type="Single selection",
# Mandatory="No"),
#
# data.frame(
# Variable="EventVendorCode",
# Label="Vendor code",
# Definition="The vendor code when Events are grouped by vendor",
# Type="Single selection",
# Mandatory="No"),
#
# data.frame(
# Variable="EventTrapCode",
# Label="Trap code",
# Definition="The vendor code when Events are grouped by trap",
# Type="Single selection",
# Mandatory="No"),
#
# data.frame(
# Variable="EventMistNetCode",
# Label="Mist net code",
# Definition="The mist net code when Events are grouped by mist net code",
# Type="Single selection",
# Mandatory="No"),
#
# data.frame(
# Variable="EventOtherSpatialUnitCode",
# Label="Other spatial unit code",
# Definition="The spatial unit code when Events are grouped by another spatial unit",
# Type="Single selection",
# Mandatory="No"),
#
# data.frame(
# Variable="EventStudyYear",
# Label="The study year",
# Definition="The temporal unit code when Events are grouped by year unit",
# Type="Single selection",
# Mandatory="No"),
#
# data.frame(
# Variable="EventStudySeason",
# Label="The study season",
# Definition="The temporal unit code when Events are grouped by study season",
# Type="Single selection",
# Mandatory="No"),
#
# data.frame(
# Variable="EventStudyMonth",
# Label="The study month",
# Definition="The temporal unit code when Events are grouped by month",
# Type="Single selection",
# Mandatory="No"),
#
# data.frame(
# Variable="EventStudyWeek",
# Label="The study week",
# Definition="The temporal unit code when Events are grouped by week",
# Type="Single selection",
# Mandatory="No"),
#
# data.frame(
# Variable="EventStudyDayPeriod",
# Label="The study day period",
# Definition="The temporal unit code when Events are grouped by study day",
# Type="Single selection",
# Mandatory="No"),
#
# data.frame(
# Variable="EventStudyHour",
# Label="The study hour",
# Definition="The temporal unit code when Events are grouped by study hour",
# Type="Single selection",
# Mandatory="No"),
#
# data.frame(
# Variable="EventOtherTemporalUnit",
# Label="Other spatial temporal unit code",
# Definition="The temporal unit code when Events are grouped by another temporal unit",
# Type="Single selection",
# Mandatory="No"),
#
# data.frame(
# Variable="EventTimeAssembled",
# Label="Time assembled",
# Definition="The time a trap or similar representing an Event is set up",
# Type="Datetime",
# Mandatory="No"),
#
# data.frame(
# Variable="EventTimeDisassembled",
# Label="Time disassembled",
# Definition="The time a trap or similar representing an Event is dissamsembled",
# Type="Datetime",
# Mandatory="No")
#
# )
event<-
event %>% bind_rows() |>
gt::gt() %>%
gt::tab_options(table.font.size = 8) %>%
gt::cols_width(Variable ~ gt::pct(22),
Label ~ gt::pct(20),
Definition ~ gt::pct(30),
Type~ gt::pct(13),
Mandatory~ gt::pct(15)) %>%
gt::tab_style(
style = cell_text(size = px(15), weight = "bold"),
locations = cells_column_labels())