-
Notifications
You must be signed in to change notification settings - Fork 1
/
tutorial-1-create-spatial-object.html
708 lines (645 loc) · 129 KB
/
tutorial-1-create-spatial-object.html
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
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
<meta name="author" content="JR Ferrer-Paris" />
<meta name="progressive" content="true" />
<meta name="allow-skip" content="true" />
<meta name="learnr-version-prerender" content="0.10.1.9019" />
<title>Geo-spatial tutorial: create a simple feature</title>
<!-- header-includes START -->
<!-- HEAD_CONTENT -->
<!-- header-includes END -->
<!-- HEAD_CONTENT -->
<!-- highlightjs -->
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
pre:not([class]) {
background-color: white;
}
</style>
<script type="text/javascript">
if (window.hljs) {
hljs.configure({languages: []});
hljs.initHighlightingOnLoad();
if (document.readyState && document.readyState === "complete") {
window.setTimeout(function() { hljs.initHighlighting(); }, 0);
}
}
</script>
<!-- taken from https://github.com/rstudio/rmarkdown/blob/de8a9c38618903627ca509f5401d50a0876079f7/inst/rmd/h/default.html#L293-L343 -->
<!-- tabsets -->
<style type="text/css">
.tabset-dropdown > .nav-tabs {
display: inline-table;
max-height: 500px;
min-height: 44px;
overflow-y: auto;
border: 1px solid #ddd;
border-radius: 4px;
}
.tabset-dropdown > .nav-tabs > li.active:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li.active:before {
content: "";
border: none;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs > li.active {
display: block;
}
.tabset-dropdown > .nav-tabs > li > a,
.tabset-dropdown > .nav-tabs > li > a:focus,
.tabset-dropdown > .nav-tabs > li > a:hover {
border: none;
display: inline-block;
border-radius: 4px;
background-color: transparent;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li {
display: block;
float: none;
}
.tabset-dropdown > .nav-tabs > li {
display: none;
}
</style>
<!-- end tabsets -->
</head>
<body>
<div class="pageContent band">
<div class="bandContent page">
<div class="topics">
<div id="section-welcome" class="section level2">
<h2>Welcome</h2>
<p>This is part 1 of a series of introductory tutorials to work with geo-spatial data in R. I prepared these tutorials as a intuitive “hands on” introduction, but I provide links for those interested in more background and theory.</p>
<p>In this tutorial, you will learn how to create a spatial object with package <code>sf</code> (simple features).</p>
<div id="section-setup" class="section level3">
<h3>Setup</h3>
<p>I’ve preloaded the packages for this tutorial with</p>
<pre class="r"><code>library(sf)
library(leaflet)
library(mapview)
library(leafpop)</code></pre>
<p>For this tutorial we will <strong>create our own spatial objects from scratch</strong>, so we don’t need to load any additional data.</p>
</div>
</div>
<div id="section-creating-a-spatial-object-in-r" class="section level2">
<h2>Creating a spatial object in R</h2>
<p>For the first part of this tutorial we will create our own spatial objects.</p>
<div id="section-create-points-using-package-sf" class="section level3">
<h3>Create points using package <code>sf</code></h3>
<p>There are many alternative ways to define and work with geo-spatial data in R, but the <em>simple features</em> approach in package <code>sf</code> has many advantages and has become the <em>new</em> standard.</p>
<p>Simple features are a standardized way to encode spatial vector data. This package binds to several external libraries like <code>GDAL</code>, <code>GEOS</code> and <code>PROJ</code> for many spatial operations.</p>
<p>If you want to understand simple features in R, you should visit the <a href="https://r-spatial.github.io/sf/articles/">documentation of the <code>sf</code> package</a>.</p>
<p>Functions from package <code>sf</code> have the prefix <code>st_</code>. Many of these functions are described by the <em>simple features</em> standard, so, if you are familiar with spatial databases such as PostGIS and other GIS software, you might recognise many of these.</p>
</div>
<div id="section-the-geometry" class="section level3">
<h3>The geometry</h3>
<p>A simple feature needs to have a <em>geometry</em>, this can be a point, multi-point, linestring, multi-linestring, polygon, multi-polygon, it can also be linked to a collection of several geometries.</p>
<p>In R you can use this function to define a point geometry:</p>
<pre class="r"><code>my_geom <- st_point(c(23.978333, 38.118056))</code></pre>
<p>For geospatial data we need to define a coordinate reference system (<em>crs</em>) to interpret these coordinates correctly. They are usually defined by several parameters in a standard format (with heavy use of geospatial jargon), but there are handy shortcuts for the most common examples. Here we will focus on plain latitude and longitude coordinates, known as the <em>latlong</em> projection based on the <em>WGS84</em> datum, this is also referred to as <em>EPSG:4326</em> (Check details at <a href="https://epsg.io/4326" class="uri">https://epsg.io/4326</a>)</p>
<pre class="r"><code>my_crs <- st_crs("+proj=latlong +datum=WGS84")</code></pre>
</div>
<div id="section-the-data" class="section level3">
<h3>The data</h3>
<p>Typically you will want to attach one or more attributes or variables to your geometry, for example we can start with a name, some properties, a year, and maybe a url link in a data frame (or a tibble):</p>
<pre class="r"><code>data <- data.frame(name=c('Marathon'),
famous_for=c('Battle of Marathon'),
url=c('https://en.wikipedia.org/wiki/Battle_of_Marathon'),
year=c(-490))</code></pre>
<p>But you are not limited by this, you can have a data frame with many columns, each column can represent a variable, a measurement, you can have factors, texts, colors, etc.</p>
<p>Each row in the data frame represents an observation or element, so they need to match the number of spatial features. In this case it is easy with just one point and one row in the data frame, but keep this in mind when creating your own objects!</p>
</div>
<div id="section-bringing-geometry-and-data-together" class="section level3">
<h3>Bringing geometry and data together</h3>
<p>So we are now ready to make our <em>simple feature</em> object,</p>
<p>One way to put this together and create a simple feature with function <code>st_sf</code> is this:</p>
<pre class="r"><code>hellas1 <- st_sf(data,
crs=my_crs,
geometry=st_sfc(my_geom))</code></pre>
<p>Notice that I am using <code>st_sfc</code> to combine the geometry and <em>crs</em> into a <em>simple feature geometry list column</em>.</p>
</div>
<div id="section-exercise-1" class="section level3">
<h3>Exercise 1</h3>
<p>Let’s create our own simple feature object for this tutorial.</p>
<p>We want to define a point for the city of Sparta with the supplied coordinates and <em>crs</em> (EPSG code is 4326), fill the blanks with the names of the functions and hit run:</p>
<div class="tutorial-exercise" data-label="sfex1" data-completion="1" data-diagnostics="1" data-startover="1" data-lines="0">
<pre class="text"><code>#my_data <- ____(name='This is Sparta!')
#my_crs <- ____("EPSG:4326")
#my_geom <- ____(c(22.431028, 37.075074))
#sparta <- st_sf(my_data,
# crs=my_crs,
# geometry=____)
#print(sparta)</code></pre>
<script type="application/json" data-ui-opts="1">{"engine":"r","has_checker":true,"caption":"<span data-i18n=\"text.enginecap\" data-i18n-opts=\"{"engine":"R"}\">R Code<\/span>"}</script>
</div>
<div class="tutorial-exercise-support" data-label="sfex1-solution" data-completion="1" data-diagnostics="1" data-startover="1" data-lines="0">
<pre class="text"><code>my_data <- data.frame(name='This is Sparta!')
my_crs <- st_crs("EPSG:4326")
my_geom <- st_point(c(22.431028, 37.075074))
sparta <- st_sf(my_data,
crs=my_crs,
geometry=st_sfc(my_geom))</code></pre>
</div>
<div id="section-sfex1-hint">
<p><strong>Hint:</strong> You need to define the data and the simple feature collection to create your object. Use functions <code>st_point</code>, <code>st_crs</code> and <code>st_sfc</code>.</p>
</div>
</div>
<div id="section-more-than-one-point-in-a-single-object" class="section level3">
<h3>More than one point in a single object</h3>
<p>If we want to combine several points into one <em>simple feature</em> object, and assuming all share the same <em>crs</em>:</p>
<pre class="r"><code>pt2 <- st_point(c( 23.2, 39.05))
pt3 <- st_point(c(20.716667, 38.366667))
data <- data.frame(name=c('Arthemision','Ithaca'),
famous_for=c('Battle of Arthemision', "Homer's Odyssey"),
url=c('https://en.wikipedia.org/wiki/Battle_of_Artemisium', 'https://en.wikipedia.org/wiki/Ithaca'),
year=c(-480,-800))
hellas2 <- st_sf(data,
crs=my_crs,
geometry=st_sfc(pt2,pt3))</code></pre>
<p>Each point will have their own attributes or variables.</p>
</div>
<div id="section-section" class="section level3">
<h3></h3>
<p>What about combining existing object to create a new one?</p>
<p>You can use the good old <code>rbind</code> function to combine two simple feature objects, provided they share the same columns, run the code to verify the result:</p>
<div class="tutorial-exercise" data-label="sfex2" data-completion="1" data-diagnostics="1" data-startover="1" data-lines="0">
<pre class="text"><code>not_sparta <- rbind(hellas1, hellas2)
not_sparta</code></pre>
<script type="application/json" data-ui-opts="1">{"engine":"r","has_checker":false,"caption":"<span data-i18n=\"text.enginecap\" data-i18n-opts=\"{"engine":"R"}\">R Code<\/span>"}</script>
</div>
<p>The output will tell you many interesting attributes of your newly created object, and we can confirm that we now have three features.</p>
</div>
<div id="section-section-1" class="section level3">
<h3></h3>
<p>But if one of the objects has different columns, this will not work:</p>
<div class="tutorial-exercise" data-label="sfex3" data-completion="1" data-diagnostics="1" data-startover="1" data-lines="0">
<pre class="text"><code>with_sparta <- rbind(hellas1, sparta)
with_sparta</code></pre>
<script type="application/json" data-ui-opts="1">{"engine":"r","has_checker":false,"caption":"<span data-i18n=\"text.enginecap\" data-i18n-opts=\"{"engine":"R"}\">R Code<\/span>"}</script>
</div>
<div class="tutorial-exercise-support" data-label="sfex3-solution" data-completion="1" data-diagnostics="1" data-startover="1" data-lines="0">
<pre class="text"><code># you can make it work if you add the missing variables:
sparta$famous_for <- NA
sparta$url <- NA
sparta$year <- NA
# try again:
with_sparta <- rbind(hellas1, sparta)
with_sparta</code></pre>
</div>
</div>
<div id="section-good-job" class="section level3">
<h3>Good job!</h3>
<p>We just created our first spatial object, how cool is that?</p>
<p>So we learned to:</p>
<ul>
<li>use package <code>sf</code></li>
<li>define a geometry with <code>st_points</code></li>
<li>assign a coordinate reference system with <code>st_crs</code></li>
<li>create a spatial object with <code>st_sf</code> by combining a data frame with a simple feature column with <code>st_sfc</code></li>
<li>combine <code>sf</code> objects with <code>rbind</code></li>
</ul>
<p>But what can we do with these sets of points? Let’s do some more spatial stuff like calculating distance and mapping in the next section!</p>
</div>
</div>
<div id="section-spatial-functions-and-visualisation" class="section level2">
<h2>Spatial functions and visualisation</h2>
<p>Functions from package <code>sf</code> have the prefix <code>st_</code>. Many of these functions are described by the <em>simple features</em> standard, so, if you are familiar with spatial databases such as PostGIS and other GIS software, you might recognise many of these.</p>
<div id="section-section-2" class="section level3">
<h3></h3>
<p>If you want to know which functions are available for your newly created object, you can use the <code>methods</code> function:</p>
<pre class="r"><code>class(hellas1)</code></pre>
<pre><code>## [1] "sf" "data.frame"</code></pre>
<pre class="r"><code>methods(class = "sf")</code></pre>
<pre><code>## [1] [ [[<- $<-
## [4] aggregate as.data.frame cbind
## [7] coerce dbDataType dbWriteTable
## [10] filter identify initialize
## [13] mapView merge plot
## [16] print rbind show
## [19] slotsFromS3 st_agr st_agr<-
## [22] st_area st_as_s2 st_as_sf
## [25] st_as_sfc st_bbox st_boundary
## [28] st_buffer st_cast st_centroid
## [31] st_collection_extract st_convex_hull st_coordinates
## [34] st_crop st_crs st_crs<-
## [37] st_difference st_drop_geometry st_filter
## [40] st_geometry st_geometry<- st_inscribed_circle
## [43] st_interpolate_aw st_intersection st_intersects
## [46] st_is_valid st_is st_join
## [49] st_line_merge st_m_range st_make_valid
## [52] st_nearest_points st_node st_normalize
## [55] st_point_on_surface st_polygonize st_precision
## [58] st_reverse st_sample st_segmentize
## [61] st_set_precision st_shift_longitude st_simplify
## [64] st_snap st_sym_difference st_transform
## [67] st_triangulate st_union st_voronoi
## [70] st_wrap_dateline st_write st_z_range
## [73] st_zm transform
## see '?methods' for accessing help and source code</code></pre>
<p>For now we will focus on two functions that will help us find the nearest feature to one point of interest.</p>
</div>
<div id="section-calculating-distance-between-features" class="section level3">
<h3>Calculating distance between features</h3>
<p>The function <code>st_distance</code> will find the distance between spatial features in an object or between two sets of spatial features. In the excercise box you can un-comment one line at a time and compare the different results:</p>
<div class="tutorial-exercise" data-label="distex1" data-completion="1" data-diagnostics="1" data-startover="1" data-lines="0">
<pre class="text"><code>#st_distance(not_sparta) # internal distance
#st_distance(sparta,not_sparta) # distance between points in each object
#st_distance(not_sparta,sparta) # same as above</code></pre>
<script type="application/json" data-ui-opts="1">{"engine":"r","has_checker":false,"caption":"<span data-i18n=\"text.enginecap\" data-i18n-opts=\"{"engine":"R"}\">R Code<\/span>"}</script>
</div>
<p>In this small example is easy to find which feature is nearest (smaller distance) to a feature of interest. But in more complex examples with hundreds or thousands of features it is handy to have a shortcut.</p>
</div>
<div id="section-section-3" class="section level3">
<h3></h3>
<p>Finding the nearest feature is one of the most common queries related to spatial data, so much so that it has its own function: <code>st_nearest_feature</code>. Let’s find out which location is nearest to Sparta:</p>
<div class="tutorial-exercise" data-label="distex2" data-completion="1" data-diagnostics="1" data-startover="1" data-lines="0">
<pre class="text"><code> not_sparta[st_nearest_feature(sparta,not_sparta),]</code></pre>
<script type="application/json" data-ui-opts="1">{"engine":"r","has_checker":false,"caption":"<span data-i18n=\"text.enginecap\" data-i18n-opts=\"{"engine":"R"}\">R Code<\/span>"}</script>
</div>
</div>
<div id="section-visualising-and-exploring-the-data" class="section level3">
<h3>Visualising and exploring the data</h3>
<p>Exploring spatial data is mostly about context, and very often we need to have a quick view of our features. The best way to do this is to plot together several spatial objects and to add a base map that we can zoom and navigate.</p>
<p>We can do this directly in R thanks to the <code>mapview</code> package. This packages uses functions of the <em>Leaflet</em> open-source JavaScript library for interactive maps.</p>
<p>An interactive map of the points is as easy as:</p>
<pre class="r"><code>mapview(not_sparta, col.regions = "blanchedalmond")</code></pre>
<div id="htmlwidget-9450b8e16c83e57d0520" style="width:624px;height:384px;" class="leaflet html-widget"></div>
<script type="application/json" data-for="htmlwidget-9450b8e16c83e57d0520">{"x":{"options":{"minZoom":1,"maxZoom":52,"crs":{"crsClass":"L.CRS.EPSG3857","code":null,"proj4def":null,"projectedBounds":null,"options":{}},"preferCanvas":false,"bounceAtZoomLimits":false,"maxBounds":[[[-90,-370]],[[90,370]]]},"calls":[{"method":"addProviderTiles","args":["CartoDB.DarkMatter","CartoDB.DarkMatter","CartoDB.DarkMatter",{"errorTileUrl":"","noWrap":false,"detectRetina":false,"pane":"tilePane"}]},{"method":"addProviderTiles","args":["CartoDB.Positron","CartoDB.Positron","CartoDB.Positron",{"errorTileUrl":"","noWrap":false,"detectRetina":false,"pane":"tilePane"}]},{"method":"addProviderTiles","args":["OpenStreetMap","OpenStreetMap","OpenStreetMap",{"errorTileUrl":"","noWrap":false,"detectRetina":false,"pane":"tilePane"}]},{"method":"addProviderTiles","args":["Esri.WorldImagery","Esri.WorldImagery","Esri.WorldImagery",{"errorTileUrl":"","noWrap":false,"detectRetina":false,"pane":"tilePane"}]},{"method":"addProviderTiles","args":["OpenTopoMap","OpenTopoMap","OpenTopoMap",{"errorTileUrl":"","noWrap":false,"detectRetina":false,"pane":"tilePane"}]},{"method":"createMapPane","args":["point",440]},{"method":"addCircleMarkers","args":[[38.118056,39.05,38.366667],[23.978333,23.2,20.716667],6,null,"not_sparta",{"crs":{"crsClass":"L.CRS.EPSG3857","code":null,"proj4def":null,"projectedBounds":null,"options":{}},"pane":"point","stroke":true,"color":"#333333","weight":1,"opacity":0.9,"fill":true,"fillColor":"#FFEBCD","fillOpacity":0.6},null,null,["<div class='scrollableContainer'><table class=mapview-popup id='popup'><tr class='coord'><td><\/td><th><b>Feature ID <\/b><\/th><td>1 <\/td><\/tr><tr><td>1<\/td><th>name <\/th><td>Marathon <\/td><\/tr><tr><td>2<\/td><th>famous_for <\/th><td>Battle of Marathon <\/td><\/tr><tr><td>3<\/td><th>url <\/th><td>https://en.wikipedia.org/wiki/Battle_of_Marathon <\/td><\/tr><tr><td>4<\/td><th>year <\/th><td>-490 <\/td><\/tr><tr><td>5<\/td><th>geometry <\/th><td>sfc_POINT <\/td><\/tr><\/table><\/div>","<div class='scrollableContainer'><table class=mapview-popup id='popup'><tr class='coord'><td><\/td><th><b>Feature ID <\/b><\/th><td>2 <\/td><\/tr><tr><td>1<\/td><th>name <\/th><td>Arthemision <\/td><\/tr><tr><td>2<\/td><th>famous_for <\/th><td>Battle of Arthemision <\/td><\/tr><tr><td>3<\/td><th>url <\/th><td>https://en.wikipedia.org/wiki/Battle_of_Artemisium <\/td><\/tr><tr><td>4<\/td><th>year <\/th><td>-480 <\/td><\/tr><tr><td>5<\/td><th>geometry <\/th><td>sfc_POINT <\/td><\/tr><\/table><\/div>","<div class='scrollableContainer'><table class=mapview-popup id='popup'><tr class='coord'><td><\/td><th><b>Feature ID <\/b><\/th><td>3 <\/td><\/tr><tr><td>1<\/td><th>name <\/th><td>Ithaca <\/td><\/tr><tr><td>2<\/td><th>famous_for <\/th><td>Homer's Odyssey <\/td><\/tr><tr><td>3<\/td><th>url <\/th><td>https://en.wikipedia.org/wiki/Ithaca <\/td><\/tr><tr><td>4<\/td><th>year <\/th><td>-800 <\/td><\/tr><tr><td>5<\/td><th>geometry <\/th><td>sfc_POINT <\/td><\/tr><\/table><\/div>"],{"maxWidth":800,"minWidth":50,"autoPan":true,"keepInView":false,"closeButton":true,"closeOnClick":true,"className":""},["1","2","3"],{"interactive":false,"permanent":false,"direction":"auto","opacity":1,"offset":[0,0],"textsize":"10px","textOnly":false,"className":"","sticky":true},null]},{"method":"addScaleBar","args":[{"maxWidth":100,"metric":true,"imperial":true,"updateWhenIdle":true,"position":"bottomleft"}]},{"method":"addHomeButton","args":[20.716667,38.118056,23.978333,39.05,true,"not_sparta","Zoom to not_sparta","<strong> not_sparta <\/strong>","bottomright"]},{"method":"addLayersControl","args":[["CartoDB.DarkMatter","CartoDB.Positron","OpenStreetMap","Esri.WorldImagery","OpenTopoMap"],"not_sparta",{"collapsed":true,"autoZIndex":true,"position":"topleft"}]},{"method":"addLegend","args":[{"colors":["#FFEBCD"],"labels":["not_sparta"],"na_color":null,"na_label":"NA","opacity":1,"position":"topright","type":"factor","title":"","extra":null,"layerId":null,"className":"info legend","group":"not_sparta"}]}],"limits":{"lat":[38.118056,39.05],"lng":[20.716667,23.978333]},"fitBounds":[38.118056,20.716667,39.05,23.978333,[]]},"evals":[],"jsHooks":{"render":[{"code":"function(el, x, data) {\n return (\n function(el, x, data) {\n // get the leaflet map\n var map = this; //HTMLWidgets.find('#' + el.id);\n // we need a new div element because we have to handle\n // the mouseover output separately\n // debugger;\n function addElement () {\n // generate new div Element\n var newDiv = $(document.createElement('div'));\n // append at end of leaflet htmlwidget container\n $(el).append(newDiv);\n //provide ID and style\n newDiv.addClass('lnlt');\n newDiv.css({\n 'position': 'relative',\n 'bottomleft': '0px',\n 'background-color': 'rgba(255, 255, 255, 0.7)',\n 'box-shadow': '0 0 2px #bbb',\n 'background-clip': 'padding-box',\n 'margin': '0',\n 'padding-left': '5px',\n 'color': '#333',\n 'font': '9px/1.5 \"Helvetica Neue\", Arial, Helvetica, sans-serif',\n 'z-index': '700',\n });\n return newDiv;\n }\n\n\n // check for already existing lnlt class to not duplicate\n var lnlt = $(el).find('.lnlt');\n\n if(!lnlt.length) {\n lnlt = addElement();\n\n // grab the special div we generated in the beginning\n // and put the mousmove output there\n\n map.on('mousemove', function (e) {\n if (e.originalEvent.ctrlKey) {\n if (document.querySelector('.lnlt') === null) lnlt = addElement();\n lnlt.text(\n ' lon: ' + (e.latlng.lng).toFixed(5) +\n ' | lat: ' + (e.latlng.lat).toFixed(5) +\n ' | zoom: ' + map.getZoom() +\n ' | x: ' + L.CRS.EPSG3857.project(e.latlng).x.toFixed(0) +\n ' | y: ' + L.CRS.EPSG3857.project(e.latlng).y.toFixed(0) +\n ' | epsg: 3857 ' +\n ' | proj4: +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs ');\n } else {\n if (document.querySelector('.lnlt') === null) lnlt = addElement();\n lnlt.text(\n ' lon: ' + (e.latlng.lng).toFixed(5) +\n ' | lat: ' + (e.latlng.lat).toFixed(5) +\n ' | zoom: ' + map.getZoom() + ' ');\n }\n });\n\n // remove the lnlt div when mouse leaves map\n map.on('mouseout', function (e) {\n var strip = document.querySelector('.lnlt');\n if( strip !==null) strip.remove();\n });\n\n };\n\n //$(el).keypress(67, function(e) {\n map.on('preclick', function(e) {\n if (e.originalEvent.ctrlKey) {\n if (document.querySelector('.lnlt') === null) lnlt = addElement();\n lnlt.text(\n ' lon: ' + (e.latlng.lng).toFixed(5) +\n ' | lat: ' + (e.latlng.lat).toFixed(5) +\n ' | zoom: ' + map.getZoom() + ' ');\n var txt = document.querySelector('.lnlt').textContent;\n console.log(txt);\n //txt.innerText.focus();\n //txt.select();\n setClipboardText('\"' + txt + '\"');\n }\n });\n\n }\n ).call(this.getMap(), el, x, data);\n}","data":null},{"code":"function(el, x, data) {\n return (function(el,x,data){\n var map = this;\n\n map.on('keypress', function(e) {\n console.log(e.originalEvent.code);\n var key = e.originalEvent.code;\n if (key === 'KeyE') {\n var bb = this.getBounds();\n var txt = JSON.stringify(bb);\n console.log(txt);\n\n setClipboardText('\\'' + txt + '\\'');\n }\n })\n }).call(this.getMap(), el, x, data);\n}","data":null}]}}</script>
<p>Navigation of a mapview element is quite intuitive</p>
<ul>
<li>Controls allow you to zoom and pan,</li>
<li>Use the layer icon to:
<ul>
<li>switch layers on and off</li>
<li>change the background layers</li>
</ul></li>
<li>Click on an element to:
<ul>
<li>read its table of attributes (default)</li>
<li>open a custom popup (see next example)</li>
</ul></li>
<li>There are shortcuts to zoom to each layer or for a full zoom</li>
</ul>
</div>
<div id="section-section-4" class="section level3">
<h3></h3>
<p>We can add layers to the map using the <code>+</code> operator:</p>
<pre class="r"><code> sparta.popup='https://64.media.tumblr.com/c963fce8a6e638323f5e60df33c127f3/tumblr_mq3bykOEmD1s9xi1so1_500.gif'
mapview(not_sparta, col.regions = "blanchedalmond") +
mapview(sparta, popup = popupImage(img=sparta.popup, src ="remote"))</code></pre>
<div id="htmlwidget-01140d30f9999b95ac3e" style="width:624px;height:384px;" class="leaflet html-widget"></div>
<script type="application/json" data-for="htmlwidget-01140d30f9999b95ac3e">{"x":{"options":{"minZoom":1,"maxZoom":52,"crs":{"crsClass":"L.CRS.EPSG3857","code":null,"proj4def":null,"projectedBounds":null,"options":{}},"preferCanvas":false,"bounceAtZoomLimits":false,"maxBounds":[[[-90,-370]],[[90,370]]]},"calls":[{"method":"addProviderTiles","args":["CartoDB.DarkMatter","CartoDB.DarkMatter","CartoDB.DarkMatter",{"errorTileUrl":"","noWrap":false,"detectRetina":false,"pane":"tilePane"}]},{"method":"addProviderTiles","args":["CartoDB.Positron","CartoDB.Positron","CartoDB.Positron",{"errorTileUrl":"","noWrap":false,"detectRetina":false,"pane":"tilePane"}]},{"method":"addProviderTiles","args":["OpenStreetMap","OpenStreetMap","OpenStreetMap",{"errorTileUrl":"","noWrap":false,"detectRetina":false,"pane":"tilePane"}]},{"method":"addProviderTiles","args":["Esri.WorldImagery","Esri.WorldImagery","Esri.WorldImagery",{"errorTileUrl":"","noWrap":false,"detectRetina":false,"pane":"tilePane"}]},{"method":"addProviderTiles","args":["OpenTopoMap","OpenTopoMap","OpenTopoMap",{"errorTileUrl":"","noWrap":false,"detectRetina":false,"pane":"tilePane"}]},{"method":"createMapPane","args":["point",440]},{"method":"addCircleMarkers","args":[[38.118056,39.05,38.366667],[23.978333,23.2,20.716667],6,null,"not_sparta",{"crs":{"crsClass":"L.CRS.EPSG3857","code":null,"proj4def":null,"projectedBounds":null,"options":{}},"pane":"point","stroke":true,"color":"#333333","weight":1,"opacity":0.9,"fill":true,"fillColor":"#FFEBCD","fillOpacity":0.6},null,null,["<div class='scrollableContainer'><table class=mapview-popup id='popup'><tr class='coord'><td><\/td><th><b>Feature ID <\/b><\/th><td>1 <\/td><\/tr><tr><td>1<\/td><th>name <\/th><td>Marathon <\/td><\/tr><tr><td>2<\/td><th>famous_for <\/th><td>Battle of Marathon <\/td><\/tr><tr><td>3<\/td><th>url <\/th><td>https://en.wikipedia.org/wiki/Battle_of_Marathon <\/td><\/tr><tr><td>4<\/td><th>year <\/th><td>-490 <\/td><\/tr><tr><td>5<\/td><th>geometry <\/th><td>sfc_POINT <\/td><\/tr><\/table><\/div>","<div class='scrollableContainer'><table class=mapview-popup id='popup'><tr class='coord'><td><\/td><th><b>Feature ID <\/b><\/th><td>2 <\/td><\/tr><tr><td>1<\/td><th>name <\/th><td>Arthemision <\/td><\/tr><tr><td>2<\/td><th>famous_for <\/th><td>Battle of Arthemision <\/td><\/tr><tr><td>3<\/td><th>url <\/th><td>https://en.wikipedia.org/wiki/Battle_of_Artemisium <\/td><\/tr><tr><td>4<\/td><th>year <\/th><td>-480 <\/td><\/tr><tr><td>5<\/td><th>geometry <\/th><td>sfc_POINT <\/td><\/tr><\/table><\/div>","<div class='scrollableContainer'><table class=mapview-popup id='popup'><tr class='coord'><td><\/td><th><b>Feature ID <\/b><\/th><td>3 <\/td><\/tr><tr><td>1<\/td><th>name <\/th><td>Ithaca <\/td><\/tr><tr><td>2<\/td><th>famous_for <\/th><td>Homer's Odyssey <\/td><\/tr><tr><td>3<\/td><th>url <\/th><td>https://en.wikipedia.org/wiki/Ithaca <\/td><\/tr><tr><td>4<\/td><th>year <\/th><td>-800 <\/td><\/tr><tr><td>5<\/td><th>geometry <\/th><td>sfc_POINT <\/td><\/tr><\/table><\/div>"],{"maxWidth":800,"minWidth":50,"autoPan":true,"keepInView":false,"closeButton":true,"closeOnClick":true,"className":""},["1","2","3"],{"interactive":false,"permanent":false,"direction":"auto","opacity":1,"offset":[0,0],"textsize":"10px","textOnly":false,"className":"","sticky":true},null]},{"method":"addScaleBar","args":[{"maxWidth":100,"metric":true,"imperial":true,"updateWhenIdle":true,"position":"bottomleft"}]},{"method":"addHomeButton","args":[20.716667,38.118056,23.978333,39.05,true,"not_sparta","Zoom to not_sparta","<strong> not_sparta <\/strong>","bottomright"]},{"method":"addLegend","args":[{"colors":["#FFEBCD"],"labels":["not_sparta"],"na_color":null,"na_label":"NA","opacity":1,"position":"topright","type":"factor","title":"","extra":null,"layerId":null,"className":"info legend","group":"not_sparta"}]},{"method":"addCircleMarkers","args":[37.075074,22.431028,6,null,"sparta",{"crs":{"crsClass":"L.CRS.EPSG3857","code":null,"proj4def":null,"projectedBounds":null,"options":{}},"pane":"point","stroke":true,"color":"#333333","weight":1,"opacity":0.9,"fill":true,"fillColor":"#6666FF","fillOpacity":0.6},null,null,["<html> <head> <style> #popup { font-family: Arial, Helvetica, sans-serif; width: 100%; border-collapse: collapse; } div.scrollableContainer { max-height: 2000px; max-width: 2000px; \twidth: 300px; \theight: 100%px; overflow-y: hidden; overflow-x: hidden; margin: 0px; padding: 0 0 0 0; background: transparent; } div::-webkit-scrollbar { width: 5px; height: 5px; } div::-webkit-scrollbar-button { width: 0px; height: 0px; } div::-webkit-scrollbar-thumb { background: #666666; border: 0px none #ffffff; border-radius: 0px; } div::-webkit-scrollbar-thumb:hover { background: #333333; } div::-webkit-scrollbar-thumb:active { background: #333333; } div::-webkit-scrollbar-track { background: #e1e1e1; border: 0px none #ffffff; border-radius: 50px; } div::-webkit-scrollbar-track:hover { background: #e1e1e1; } div::-webkit-scrollbar-track:active { background: #e1e1e1; } div::-webkit-scrollbar-corner { background: transparent; } .leaflet-popup { \tposition: absolute; \ttext-align: center; } .leaflet-popup-content { \tmargin: 0px 0px 0px 0px; \twidth: 300px; \theight: 100%px; } .leaflet-popup-content-wrapper { \tbackground: #ffffff; //#4c4c4c; \tbox-shadow: 0 3px 14px rgba(0,0,0,0.4); \twidth: 300px; \theight: 100%px; \tpadding: 0px; \ttext-align: left; \t-webkit-border-radius: 2px; \t border-radius: 2px; } .leaflet-popup-content-wrapper.leaflet-popup-content { \tmargin: 0px 0px 0px 0px; \twidth: 300px; \theight: 100%px; } .leaflet-popup-content p { \tmargin: 0px 0; } .leaflet-popup-tip-container { \twidth: 40px; \theight: 20px; \tposition: absolute; \tleft: 50%; \tmargin-left: -20px; \toverflow: hidden; \tpointer-events: none; } .leaflet-popup-tip { \twidth: 15px; \theight: 15px; \tpadding: 1px; \tmargin: -10px auto 0; \t-webkit-transform: rotate(45deg); \t -moz-transform: rotate(45deg); \t -ms-transform: rotate(45deg); \t -o-transform: rotate(45deg); \t transform: rotate(45deg); } .leaflet-popup-tip { \tbackground: #ffffff; //#4c4c4c; \tbox-shadow: 0 3px 14px rgba(0,0,0,0.4); } .leaflet-container a.leaflet-popup-close-button { \tposition: absolute; \ttop: 0; \tright: -20px; \tpadding: 3px 0px 0 0; \ttext-align: center; \twidth: 18px; \theight: 14px; \tfont: 16px/14px Tahoma, Verdana, sans-serif; \tcolor: #c3c3c3; \ttext-decoration: none; \tfont-weight: bold; \tbackground: transparent; \t} .leaflet-container a.leaflet-popup-close-button:hover { \tcolor: #999; \t} .leaflet-popup-scrolled { \tborder-bottom: 1px solid #ddd; \tborder-top: 1px solid #ddd; \t} <\/style> <\/head> <body> <div class=\"scrollableContainer\"> <table class=\"popup scrollable\" id=\"popup\"> <image src='https://64.media.tumblr.com/c963fce8a6e638323f5e60df33c127f3/tumblr_mq3bykOEmD1s9xi1so1_500.gif' width=300 height=100%> <\/table> <\/div> <\/body> <\/html>"],{"maxWidth":800,"minWidth":50,"autoPan":true,"keepInView":false,"closeButton":true,"closeOnClick":true,"className":""},"This is Sparta!",{"interactive":false,"permanent":false,"direction":"auto","opacity":1,"offset":[0,0],"textsize":"10px","textOnly":false,"className":"","sticky":true},null]},{"method":"addHomeButton","args":[22.431028,37.075074,22.431028,37.075074,true,"sparta","Zoom to sparta","<strong> sparta <\/strong>","bottomright"]},{"method":"addLayersControl","args":[["CartoDB.DarkMatter","CartoDB.Positron","OpenStreetMap","Esri.WorldImagery","OpenTopoMap"],["not_sparta","sparta"],{"collapsed":true,"autoZIndex":true,"position":"topleft"}]},{"method":"addLegend","args":[{"colors":["#6666FF"],"labels":["This is Sparta!"],"na_color":null,"na_label":"NA","opacity":1,"position":"topright","type":"factor","title":"","extra":null,"layerId":null,"className":"info legend","group":"sparta"}]},{"method":"addHomeButton","args":[20.716667,37.075074,23.978333,39.05,true,null,"Zoom to full extent","<strong>Zoom full<\/strong>","bottomleft"]}],"limits":{"lat":[38.118056,39.05],"lng":[20.716667,23.978333]},"fitBounds":[37.075074,20.716667,39.05,23.978333,[]]},"evals":[],"jsHooks":{"render":[{"code":"function(el, x, data) {\n return (\n function(el, x, data) {\n // get the leaflet map\n var map = this; //HTMLWidgets.find('#' + el.id);\n // we need a new div element because we have to handle\n // the mouseover output separately\n // debugger;\n function addElement () {\n // generate new div Element\n var newDiv = $(document.createElement('div'));\n // append at end of leaflet htmlwidget container\n $(el).append(newDiv);\n //provide ID and style\n newDiv.addClass('lnlt');\n newDiv.css({\n 'position': 'relative',\n 'bottomleft': '0px',\n 'background-color': 'rgba(255, 255, 255, 0.7)',\n 'box-shadow': '0 0 2px #bbb',\n 'background-clip': 'padding-box',\n 'margin': '0',\n 'padding-left': '5px',\n 'color': '#333',\n 'font': '9px/1.5 \"Helvetica Neue\", Arial, Helvetica, sans-serif',\n 'z-index': '700',\n });\n return newDiv;\n }\n\n\n // check for already existing lnlt class to not duplicate\n var lnlt = $(el).find('.lnlt');\n\n if(!lnlt.length) {\n lnlt = addElement();\n\n // grab the special div we generated in the beginning\n // and put the mousmove output there\n\n map.on('mousemove', function (e) {\n if (e.originalEvent.ctrlKey) {\n if (document.querySelector('.lnlt') === null) lnlt = addElement();\n lnlt.text(\n ' lon: ' + (e.latlng.lng).toFixed(5) +\n ' | lat: ' + (e.latlng.lat).toFixed(5) +\n ' | zoom: ' + map.getZoom() +\n ' | x: ' + L.CRS.EPSG3857.project(e.latlng).x.toFixed(0) +\n ' | y: ' + L.CRS.EPSG3857.project(e.latlng).y.toFixed(0) +\n ' | epsg: 3857 ' +\n ' | proj4: +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs ');\n } else {\n if (document.querySelector('.lnlt') === null) lnlt = addElement();\n lnlt.text(\n ' lon: ' + (e.latlng.lng).toFixed(5) +\n ' | lat: ' + (e.latlng.lat).toFixed(5) +\n ' | zoom: ' + map.getZoom() + ' ');\n }\n });\n\n // remove the lnlt div when mouse leaves map\n map.on('mouseout', function (e) {\n var strip = document.querySelector('.lnlt');\n if( strip !==null) strip.remove();\n });\n\n };\n\n //$(el).keypress(67, function(e) {\n map.on('preclick', function(e) {\n if (e.originalEvent.ctrlKey) {\n if (document.querySelector('.lnlt') === null) lnlt = addElement();\n lnlt.text(\n ' lon: ' + (e.latlng.lng).toFixed(5) +\n ' | lat: ' + (e.latlng.lat).toFixed(5) +\n ' | zoom: ' + map.getZoom() + ' ');\n var txt = document.querySelector('.lnlt').textContent;\n console.log(txt);\n //txt.innerText.focus();\n //txt.select();\n setClipboardText('\"' + txt + '\"');\n }\n });\n\n }\n ).call(this.getMap(), el, x, data);\n}","data":null},{"code":"function(el, x, data) {\n return (function(el,x,data){\n var map = this;\n\n map.on('keypress', function(e) {\n console.log(e.originalEvent.code);\n var key = e.originalEvent.code;\n if (key === 'KeyE') {\n var bb = this.getBounds();\n var txt = JSON.stringify(bb);\n console.log(txt);\n\n setClipboardText('\\'' + txt + '\\'');\n }\n })\n }).call(this.getMap(), el, x, data);\n}","data":null}]}}</script>
<p><code>mapview</code> provides functionality to view spatial objects interactively. The intention is to provide interactivity for easy and quick visualization during spatial data analysis.</p>
<p>If you want more fine-tuned, presentation quality map production you can explore the <a href="https://rstudio.github.io/leaflet/"><code>leaflet</code></a> or the <code>tmap</code> packages.</p>
</div>
<div id="section-thats-it-for-this-tutorial" class="section level3">
<h3>That’s it for this tutorial!</h3>
<p>Well, that was easy! wasn’t it?</p>
<p>We learned to:</p>
<ul>
<li>calculate distance between points with <code>st_distance</code> and <code>st_nearest_feature</code></li>
<li>map two sets of points using <code>mapview</code></li>
</ul>
<p>I hope this has been useful and you feel more confident to start working with geo-spatial data in R.</p>
Check the next tutorials in our <a href="https://github.com/UNSW-codeRs/geospatial-data-in-R">geospatial-data repository</a>
<script type="application/shiny-prerendered" data-context="server-start">
library(learnr)
library(sf)
require(leafpop)
library(leaflet)
library(mapview)
tutorial_options(
exercise.timelimit = 60,
# A simple checker function that just returns the message in the check chunk
exercise.checker = function(check_code, ...) {
list(
message = eval(parse(text = check_code)),
correct = logical(0),
type = "info",
location = "append"
)
}
)
knitr::opts_chunk$set(error = TRUE)
</script>
<script type="application/shiny-prerendered" data-context="server">
learnr:::register_http_handlers(session, metadata = NULL)
</script>
<script type="application/shiny-prerendered" data-context="server">
learnr:::prepare_tutorial_state(session)
</script>
<script type="application/shiny-prerendered" data-context="server">
learnr:::i18n_observe_tutorial_language(input, session)
</script>
<script type="application/shiny-prerendered" data-context="server">
session$onSessionEnded(function() {
learnr:::event_trigger(session, "session_stop")
})
</script>
<script type="application/shiny-prerendered" data-context="server">
`tutorial-exercise-sfex1-result` <- learnr:::setup_exercise_handler(reactive(req(input$`tutorial-exercise-sfex1-code-editor`)), session)
output$`tutorial-exercise-sfex1-output` <- renderUI({
`tutorial-exercise-sfex1-result`()
})
</script>
<script type="application/shiny-prerendered" data-context="server">
learnr:::store_exercise_cache(structure(list(global_setup = structure(c("library(learnr)",
"library(sf)", "require(leafpop)", "library(leaflet)", "library(mapview)",
"", "tutorial_options(", " exercise.timelimit = 60,", " # A simple checker function that just returns the message in the check chunk",
" exercise.checker = function(check_code, ...) {", " list(",
" message = eval(parse(text = check_code)),", " correct = logical(0),",
" type = \"info\",", " location = \"append\"", " )",
" }", ")", "knitr::opts_chunk$set(error = TRUE)", "", ""), chunk_opts = list(
label = "setup", include = FALSE)), setup = NULL, chunks = list(
list(label = "sfex1", code = "#my_data <- ____(name='This is Sparta!')\n#my_crs <- ____(\"EPSG:4326\")\n#my_geom <- ____(c(22.431028, 37.075074))\n#sparta <- st_sf(my_data,\n# crs=my_crs,\n# geometry=____)\n\n#print(sparta)\n",
opts = list(label = "\"sfex1\"", exercise = "TRUE", paged.print = "FALSE"),
engine = "r")), code_check = NULL, error_check = NULL,
check = structure("\"Great work!\\nNow you know where Sparta is!\"", chunk_opts = list(
label = "sfex1-check")), solution = structure(c("my_data <- data.frame(name='This is Sparta!')",
"my_crs <- st_crs(\"EPSG:4326\")", "my_geom <- st_point(c(22.431028, 37.075074))",
"sparta <- st_sf(my_data,", " crs=my_crs,",
" geometry=st_sfc(my_geom))"), chunk_opts = list(
label = "sfex1-solution", exercise.reveal_solution = TRUE)),
test_cases = NULL, options = list(eval = FALSE, echo = TRUE,
results = "markup", tidy = FALSE, tidy.opts = NULL, collapse = FALSE,
prompt = FALSE, comment = NA, highlight = FALSE, size = "normalsize",
background = "#F7F7F7", strip.white = TRUE, cache = 0,
cache.path = "tutorial-1-create-spatial-object_cache/html/",
cache.vars = NULL, cache.lazy = TRUE, dependson = NULL,
autodep = FALSE, cache.rebuild = FALSE, fig.keep = "high",
fig.show = "asis", fig.align = "default", fig.path = "tutorial-1-create-spatial-object_files/figure-html/",
dev = "png", dev.args = NULL, dpi = 192, fig.ext = "png",
fig.width = 6.5, fig.height = 4, fig.env = "figure",
fig.cap = NULL, fig.scap = NULL, fig.lp = "fig:", fig.subcap = NULL,
fig.pos = "", out.width = 624, out.height = NULL, out.extra = NULL,
fig.retina = 2, external = TRUE, sanitize = FALSE, interval = 1,
aniopts = "controls,loop", warning = TRUE, error = TRUE,
message = TRUE, render = NULL, ref.label = NULL, child = NULL,
engine = "r", split = FALSE, include = TRUE, purl = TRUE,
max.print = 1000, exercise.timelimit = 60, exercise.checker = "function (check_code, ...) \n{\n list(message = eval(parse(text = check_code)), correct = logical(0), \n type = \"info\", location = \"append\")\n}",
label = "sfex1", exercise = TRUE, paged.print = FALSE,
code = c("#my_data <- ____(name='This is Sparta!')",
"#my_crs <- ____(\"EPSG:4326\")", "#my_geom <- ____(c(22.431028, 37.075074))",
"#sparta <- st_sf(my_data,", "# crs=my_crs,",
"# geometry=____)", "", "#print(sparta)",
""), out.width.px = 624, out.height.px = 384, params.src = "sfex1, exercise = TRUE, paged.print=FALSE",
fig.num = 0, exercise.df_print = "paged"), engine = "r"), class = "tutorial_exercise"))
</script>
<script type="application/shiny-prerendered" data-context="server">
`tutorial-exercise-sfex2-result` <- learnr:::setup_exercise_handler(reactive(req(input$`tutorial-exercise-sfex2-code-editor`)), session)
output$`tutorial-exercise-sfex2-output` <- renderUI({
`tutorial-exercise-sfex2-result`()
})
</script>
<script type="application/shiny-prerendered" data-context="server">
learnr:::store_exercise_cache(structure(list(global_setup = structure(c("library(learnr)",
"library(sf)", "require(leafpop)", "library(leaflet)", "library(mapview)",
"", "tutorial_options(", " exercise.timelimit = 60,", " # A simple checker function that just returns the message in the check chunk",
" exercise.checker = function(check_code, ...) {", " list(",
" message = eval(parse(text = check_code)),", " correct = logical(0),",
" type = \"info\",", " location = \"append\"", " )",
" }", ")", "knitr::opts_chunk$set(error = TRUE)", "", ""), chunk_opts = list(
label = "setup", include = FALSE)), setup = "my_geom <- st_point(c(23.978333, 38.118056))\nmy_crs <- st_crs(\"+proj=latlong +datum=WGS84\")\ndata <- data.frame(name=c('Marathon'),\n famous_for=c('Battle of Marathon'),\n url=c('https://en.wikipedia.org/wiki/Battle_of_Marathon'),\n year=c(-490))\nhellas1 <- st_sf(data,\n crs=my_crs,\n geometry=st_sfc(my_geom))\n\nmy_data <- data.frame(name='This is Sparta!')\nmy_geom <- st_point(c(22.431028, 37.075074))\nsparta <- st_sf(my_data,\n crs=my_crs,\n geometry=st_sfc(my_geom))\n\npt2 <- st_point(c( 23.2, 39.05))\npt3 <- st_point(c(20.716667, 38.366667))\n\ndata <- data.frame(name=c('Arthemision','Ithaca'),\n famous_for=c('Battle of Arthemision', \"Homer's Odyssey\"),\n url=c('https://en.wikipedia.org/wiki/Battle_of_Artemisium', 'https://en.wikipedia.org/wiki/Ithaca'),\n year=c(-480,-800))\n\nhellas2 <- st_sf(data,\n crs=my_crs,\n geometry=st_sfc(pt2,pt3))\n\nnot_sparta <- rbind(hellas1, hellas2)\nnot_sparta\n",
chunks = list(list(label = "prepared-objects", code = "my_geom <- st_point(c(23.978333, 38.118056))\nmy_crs <- st_crs(\"+proj=latlong +datum=WGS84\")\ndata <- data.frame(name=c('Marathon'),\n famous_for=c('Battle of Marathon'),\n url=c('https://en.wikipedia.org/wiki/Battle_of_Marathon'),\n year=c(-490))\nhellas1 <- st_sf(data,\n crs=my_crs,\n geometry=st_sfc(my_geom))\n\nmy_data <- data.frame(name='This is Sparta!')\nmy_geom <- st_point(c(22.431028, 37.075074))\nsparta <- st_sf(my_data,\n crs=my_crs,\n geometry=st_sfc(my_geom))\n\npt2 <- st_point(c( 23.2, 39.05))\npt3 <- st_point(c(20.716667, 38.366667))\n\ndata <- data.frame(name=c('Arthemision','Ithaca'),\n famous_for=c('Battle of Arthemision', \"Homer's Odyssey\"),\n url=c('https://en.wikipedia.org/wiki/Battle_of_Artemisium', 'https://en.wikipedia.org/wiki/Ithaca'),\n year=c(-480,-800))\n\nhellas2 <- st_sf(data,\n crs=my_crs,\n geometry=st_sfc(pt2,pt3))\n\nnot_sparta <- rbind(hellas1, hellas2)\nnot_sparta\n",
opts = list(label = "\"prepared-objects\"", include = "FALSE"),
engine = "r"), list(label = "sfex2", code = "not_sparta <- rbind(hellas1, hellas2)\nnot_sparta",
opts = list(label = "\"sfex2\"", exercise = "TRUE", paged.print = "FALSE",
exercise.setup = "\"prepared-objects\""), engine = "r")),
code_check = NULL, error_check = NULL, check = NULL, solution = NULL,
test_cases = NULL, options = list(eval = FALSE, echo = TRUE,
results = "markup", tidy = FALSE, tidy.opts = NULL, collapse = FALSE,
prompt = FALSE, comment = NA, highlight = FALSE, size = "normalsize",
background = "#F7F7F7", strip.white = TRUE, cache = 0,
cache.path = "tutorial-1-create-spatial-object_cache/html/",
cache.vars = NULL, cache.lazy = TRUE, dependson = NULL,
autodep = FALSE, cache.rebuild = FALSE, fig.keep = "high",
fig.show = "asis", fig.align = "default", fig.path = "tutorial-1-create-spatial-object_files/figure-html/",
dev = "png", dev.args = NULL, dpi = 192, fig.ext = "png",
fig.width = 6.5, fig.height = 4, fig.env = "figure",
fig.cap = NULL, fig.scap = NULL, fig.lp = "fig:", fig.subcap = NULL,
fig.pos = "", out.width = 624, out.height = NULL, out.extra = NULL,
fig.retina = 2, external = TRUE, sanitize = FALSE, interval = 1,
aniopts = "controls,loop", warning = TRUE, error = TRUE,
message = TRUE, render = NULL, ref.label = NULL, child = NULL,
engine = "r", split = FALSE, include = TRUE, purl = TRUE,
max.print = 1000, exercise.timelimit = 60, exercise.checker = "function (check_code, ...) \n{\n list(message = eval(parse(text = check_code)), correct = logical(0), \n type = \"info\", location = \"append\")\n}",
label = "sfex2", exercise = TRUE, paged.print = FALSE,
exercise.setup = "prepared-objects", code = c("not_sparta <- rbind(hellas1, hellas2)",
"not_sparta"), out.width.px = 624, out.height.px = 384,
params.src = " sfex2, exercise = TRUE, paged.print=FALSE, exercise.setup = \"prepared-objects\"",
fig.num = 0, exercise.df_print = "paged"), engine = "r"), class = "tutorial_exercise"))
</script>
<script type="application/shiny-prerendered" data-context="server">
`tutorial-exercise-sfex3-result` <- learnr:::setup_exercise_handler(reactive(req(input$`tutorial-exercise-sfex3-code-editor`)), session)
output$`tutorial-exercise-sfex3-output` <- renderUI({
`tutorial-exercise-sfex3-result`()
})
</script>
<script type="application/shiny-prerendered" data-context="server">
learnr:::store_exercise_cache(structure(list(global_setup = structure(c("library(learnr)",
"library(sf)", "require(leafpop)", "library(leaflet)", "library(mapview)",
"", "tutorial_options(", " exercise.timelimit = 60,", " # A simple checker function that just returns the message in the check chunk",
" exercise.checker = function(check_code, ...) {", " list(",
" message = eval(parse(text = check_code)),", " correct = logical(0),",
" type = \"info\",", " location = \"append\"", " )",
" }", ")", "knitr::opts_chunk$set(error = TRUE)", "", ""), chunk_opts = list(
label = "setup", include = FALSE)), setup = "my_geom <- st_point(c(23.978333, 38.118056))\nmy_crs <- st_crs(\"+proj=latlong +datum=WGS84\")\ndata <- data.frame(name=c('Marathon'),\n famous_for=c('Battle of Marathon'),\n url=c('https://en.wikipedia.org/wiki/Battle_of_Marathon'),\n year=c(-490))\nhellas1 <- st_sf(data,\n crs=my_crs,\n geometry=st_sfc(my_geom))\n\nmy_data <- data.frame(name='This is Sparta!')\nmy_geom <- st_point(c(22.431028, 37.075074))\nsparta <- st_sf(my_data,\n crs=my_crs,\n geometry=st_sfc(my_geom))\n\npt2 <- st_point(c( 23.2, 39.05))\npt3 <- st_point(c(20.716667, 38.366667))\n\ndata <- data.frame(name=c('Arthemision','Ithaca'),\n famous_for=c('Battle of Arthemision', \"Homer's Odyssey\"),\n url=c('https://en.wikipedia.org/wiki/Battle_of_Artemisium', 'https://en.wikipedia.org/wiki/Ithaca'),\n year=c(-480,-800))\n\nhellas2 <- st_sf(data,\n crs=my_crs,\n geometry=st_sfc(pt2,pt3))\n\nnot_sparta <- rbind(hellas1, hellas2)\nnot_sparta\n",
chunks = list(list(label = "prepared-objects", code = "my_geom <- st_point(c(23.978333, 38.118056))\nmy_crs <- st_crs(\"+proj=latlong +datum=WGS84\")\ndata <- data.frame(name=c('Marathon'),\n famous_for=c('Battle of Marathon'),\n url=c('https://en.wikipedia.org/wiki/Battle_of_Marathon'),\n year=c(-490))\nhellas1 <- st_sf(data,\n crs=my_crs,\n geometry=st_sfc(my_geom))\n\nmy_data <- data.frame(name='This is Sparta!')\nmy_geom <- st_point(c(22.431028, 37.075074))\nsparta <- st_sf(my_data,\n crs=my_crs,\n geometry=st_sfc(my_geom))\n\npt2 <- st_point(c( 23.2, 39.05))\npt3 <- st_point(c(20.716667, 38.366667))\n\ndata <- data.frame(name=c('Arthemision','Ithaca'),\n famous_for=c('Battle of Arthemision', \"Homer's Odyssey\"),\n url=c('https://en.wikipedia.org/wiki/Battle_of_Artemisium', 'https://en.wikipedia.org/wiki/Ithaca'),\n year=c(-480,-800))\n\nhellas2 <- st_sf(data,\n crs=my_crs,\n geometry=st_sfc(pt2,pt3))\n\nnot_sparta <- rbind(hellas1, hellas2)\nnot_sparta\n",
opts = list(label = "\"prepared-objects\"", include = "FALSE"),
engine = "r"), list(label = "sfex3", code = "with_sparta <- rbind(hellas1, sparta)\nwith_sparta",
opts = list(label = "\"sfex3\"", exercise = "TRUE", paged.print = "FALSE",
exercise.setup = "\"prepared-objects\"", error = "TRUE"),
engine = "r")), code_check = NULL, error_check = NULL,
check = NULL, solution = structure(c("# you can make it work if you add the missing variables:",
"sparta$famous_for <- NA", "sparta$url <- NA", "sparta$year <- NA",
"# try again:", "with_sparta <- rbind(hellas1, sparta)",
"with_sparta"), chunk_opts = list(label = "sfex3-solution",
exercise.reveal_solution = TRUE)), test_cases = NULL,
options = list(eval = FALSE, echo = TRUE, results = "markup",
tidy = FALSE, tidy.opts = NULL, collapse = FALSE, prompt = FALSE,
comment = NA, highlight = FALSE, size = "normalsize",
background = "#F7F7F7", strip.white = TRUE, cache = 0,
cache.path = "tutorial-1-create-spatial-object_cache/html/",
cache.vars = NULL, cache.lazy = TRUE, dependson = NULL,
autodep = FALSE, cache.rebuild = FALSE, fig.keep = "high",
fig.show = "asis", fig.align = "default", fig.path = "tutorial-1-create-spatial-object_files/figure-html/",
dev = "png", dev.args = NULL, dpi = 192, fig.ext = "png",
fig.width = 6.5, fig.height = 4, fig.env = "figure",
fig.cap = NULL, fig.scap = NULL, fig.lp = "fig:", fig.subcap = NULL,
fig.pos = "", out.width = 624, out.height = NULL, out.extra = NULL,
fig.retina = 2, external = TRUE, sanitize = FALSE, interval = 1,
aniopts = "controls,loop", warning = TRUE, error = TRUE,
message = TRUE, render = NULL, ref.label = NULL, child = NULL,
engine = "r", split = FALSE, include = TRUE, purl = TRUE,
max.print = 1000, exercise.timelimit = 60, exercise.checker = "function (check_code, ...) \n{\n list(message = eval(parse(text = check_code)), correct = logical(0), \n type = \"info\", location = \"append\")\n}",
label = "sfex3", exercise = TRUE, paged.print = FALSE,
exercise.setup = "prepared-objects", code = c("with_sparta <- rbind(hellas1, sparta)",
"with_sparta"), out.width.px = 624, out.height.px = 384,
params.src = " sfex3, exercise = TRUE, paged.print=FALSE, exercise.setup = \"prepared-objects\", error=TRUE",
fig.num = 0, exercise.df_print = "paged"), engine = "r"), class = "tutorial_exercise"))
</script>
<script type="application/shiny-prerendered" data-context="server">
`tutorial-exercise-distex1-result` <- learnr:::setup_exercise_handler(reactive(req(input$`tutorial-exercise-distex1-code-editor`)), session)
output$`tutorial-exercise-distex1-output` <- renderUI({
`tutorial-exercise-distex1-result`()
})
</script>
<script type="application/shiny-prerendered" data-context="server">
learnr:::store_exercise_cache(structure(list(global_setup = structure(c("library(learnr)",
"library(sf)", "require(leafpop)", "library(leaflet)", "library(mapview)",
"", "tutorial_options(", " exercise.timelimit = 60,", " # A simple checker function that just returns the message in the check chunk",
" exercise.checker = function(check_code, ...) {", " list(",
" message = eval(parse(text = check_code)),", " correct = logical(0),",
" type = \"info\",", " location = \"append\"", " )",
" }", ")", "knitr::opts_chunk$set(error = TRUE)", "", ""), chunk_opts = list(
label = "setup", include = FALSE)), setup = "my_geom <- st_point(c(23.978333, 38.118056))\nmy_crs <- st_crs(\"+proj=latlong +datum=WGS84\")\ndata <- data.frame(name=c('Marathon'),\n famous_for=c('Battle of Marathon'),\n url=c('https://en.wikipedia.org/wiki/Battle_of_Marathon'),\n year=c(-490))\nhellas1 <- st_sf(data,\n crs=my_crs,\n geometry=st_sfc(my_geom))\n\nmy_data <- data.frame(name='This is Sparta!')\nmy_geom <- st_point(c(22.431028, 37.075074))\nsparta <- st_sf(my_data,\n crs=my_crs,\n geometry=st_sfc(my_geom))\n\npt2 <- st_point(c( 23.2, 39.05))\npt3 <- st_point(c(20.716667, 38.366667))\n\ndata <- data.frame(name=c('Arthemision','Ithaca'),\n famous_for=c('Battle of Arthemision', \"Homer's Odyssey\"),\n url=c('https://en.wikipedia.org/wiki/Battle_of_Artemisium', 'https://en.wikipedia.org/wiki/Ithaca'),\n year=c(-480,-800))\n\nhellas2 <- st_sf(data,\n crs=my_crs,\n geometry=st_sfc(pt2,pt3))\n\nnot_sparta <- rbind(hellas1, hellas2)\nnot_sparta\n",
chunks = list(list(label = "prepared-objects", code = "my_geom <- st_point(c(23.978333, 38.118056))\nmy_crs <- st_crs(\"+proj=latlong +datum=WGS84\")\ndata <- data.frame(name=c('Marathon'),\n famous_for=c('Battle of Marathon'),\n url=c('https://en.wikipedia.org/wiki/Battle_of_Marathon'),\n year=c(-490))\nhellas1 <- st_sf(data,\n crs=my_crs,\n geometry=st_sfc(my_geom))\n\nmy_data <- data.frame(name='This is Sparta!')\nmy_geom <- st_point(c(22.431028, 37.075074))\nsparta <- st_sf(my_data,\n crs=my_crs,\n geometry=st_sfc(my_geom))\n\npt2 <- st_point(c( 23.2, 39.05))\npt3 <- st_point(c(20.716667, 38.366667))\n\ndata <- data.frame(name=c('Arthemision','Ithaca'),\n famous_for=c('Battle of Arthemision', \"Homer's Odyssey\"),\n url=c('https://en.wikipedia.org/wiki/Battle_of_Artemisium', 'https://en.wikipedia.org/wiki/Ithaca'),\n year=c(-480,-800))\n\nhellas2 <- st_sf(data,\n crs=my_crs,\n geometry=st_sfc(pt2,pt3))\n\nnot_sparta <- rbind(hellas1, hellas2)\nnot_sparta\n",
opts = list(label = "\"prepared-objects\"", include = "FALSE"),
engine = "r"), list(label = "distex1", code = "#st_distance(not_sparta) # internal distance\n#st_distance(sparta,not_sparta) # distance between points in each object\n#st_distance(not_sparta,sparta) # same as above",
opts = list(label = "\"distex1\"", exercise = "TRUE",
paged.print = "FALSE", exercise.setup = "\"prepared-objects\""),
engine = "r")), code_check = NULL, error_check = NULL,
check = NULL, solution = NULL, test_cases = NULL, options = list(
eval = FALSE, echo = TRUE, results = "markup", tidy = FALSE,
tidy.opts = NULL, collapse = FALSE, prompt = FALSE, comment = NA,
highlight = FALSE, size = "normalsize", background = "#F7F7F7",
strip.white = TRUE, cache = 0, cache.path = "tutorial-1-create-spatial-object_cache/html/",
cache.vars = NULL, cache.lazy = TRUE, dependson = NULL,
autodep = FALSE, cache.rebuild = FALSE, fig.keep = "high",
fig.show = "asis", fig.align = "default", fig.path = "tutorial-1-create-spatial-object_files/figure-html/",
dev = "png", dev.args = NULL, dpi = 192, fig.ext = "png",
fig.width = 6.5, fig.height = 4, fig.env = "figure",
fig.cap = NULL, fig.scap = NULL, fig.lp = "fig:", fig.subcap = NULL,
fig.pos = "", out.width = 624, out.height = NULL, out.extra = NULL,
fig.retina = 2, external = TRUE, sanitize = FALSE, interval = 1,
aniopts = "controls,loop", warning = TRUE, error = TRUE,
message = TRUE, render = NULL, ref.label = NULL, child = NULL,
engine = "r", split = FALSE, include = TRUE, purl = TRUE,
max.print = 1000, exercise.timelimit = 60, exercise.checker = "function (check_code, ...) \n{\n list(message = eval(parse(text = check_code)), correct = logical(0), \n type = \"info\", location = \"append\")\n}",
label = "distex1", exercise = TRUE, paged.print = FALSE,
exercise.setup = "prepared-objects", code = c("#st_distance(not_sparta) # internal distance",
"#st_distance(sparta,not_sparta) # distance between points in each object",
"#st_distance(not_sparta,sparta) # same as above"), out.width.px = 624,
out.height.px = 384, params.src = " distex1, exercise = TRUE, paged.print=FALSE, exercise.setup = \"prepared-objects\"",
fig.num = 0, exercise.df_print = "paged"), engine = "r"), class = "tutorial_exercise"))
</script>
<script type="application/shiny-prerendered" data-context="server">
`tutorial-exercise-distex2-result` <- learnr:::setup_exercise_handler(reactive(req(input$`tutorial-exercise-distex2-code-editor`)), session)
output$`tutorial-exercise-distex2-output` <- renderUI({
`tutorial-exercise-distex2-result`()
})
</script>
<script type="application/shiny-prerendered" data-context="server">
learnr:::store_exercise_cache(structure(list(global_setup = structure(c("library(learnr)",
"library(sf)", "require(leafpop)", "library(leaflet)", "library(mapview)",
"", "tutorial_options(", " exercise.timelimit = 60,", " # A simple checker function that just returns the message in the check chunk",
" exercise.checker = function(check_code, ...) {", " list(",
" message = eval(parse(text = check_code)),", " correct = logical(0),",
" type = \"info\",", " location = \"append\"", " )",
" }", ")", "knitr::opts_chunk$set(error = TRUE)", "", ""), chunk_opts = list(
label = "setup", include = FALSE)), setup = "my_geom <- st_point(c(23.978333, 38.118056))\nmy_crs <- st_crs(\"+proj=latlong +datum=WGS84\")\ndata <- data.frame(name=c('Marathon'),\n famous_for=c('Battle of Marathon'),\n url=c('https://en.wikipedia.org/wiki/Battle_of_Marathon'),\n year=c(-490))\nhellas1 <- st_sf(data,\n crs=my_crs,\n geometry=st_sfc(my_geom))\n\nmy_data <- data.frame(name='This is Sparta!')\nmy_geom <- st_point(c(22.431028, 37.075074))\nsparta <- st_sf(my_data,\n crs=my_crs,\n geometry=st_sfc(my_geom))\n\npt2 <- st_point(c( 23.2, 39.05))\npt3 <- st_point(c(20.716667, 38.366667))\n\ndata <- data.frame(name=c('Arthemision','Ithaca'),\n famous_for=c('Battle of Arthemision', \"Homer's Odyssey\"),\n url=c('https://en.wikipedia.org/wiki/Battle_of_Artemisium', 'https://en.wikipedia.org/wiki/Ithaca'),\n year=c(-480,-800))\n\nhellas2 <- st_sf(data,\n crs=my_crs,\n geometry=st_sfc(pt2,pt3))\n\nnot_sparta <- rbind(hellas1, hellas2)\nnot_sparta\n",
chunks = list(list(label = "prepared-objects", code = "my_geom <- st_point(c(23.978333, 38.118056))\nmy_crs <- st_crs(\"+proj=latlong +datum=WGS84\")\ndata <- data.frame(name=c('Marathon'),\n famous_for=c('Battle of Marathon'),\n url=c('https://en.wikipedia.org/wiki/Battle_of_Marathon'),\n year=c(-490))\nhellas1 <- st_sf(data,\n crs=my_crs,\n geometry=st_sfc(my_geom))\n\nmy_data <- data.frame(name='This is Sparta!')\nmy_geom <- st_point(c(22.431028, 37.075074))\nsparta <- st_sf(my_data,\n crs=my_crs,\n geometry=st_sfc(my_geom))\n\npt2 <- st_point(c( 23.2, 39.05))\npt3 <- st_point(c(20.716667, 38.366667))\n\ndata <- data.frame(name=c('Arthemision','Ithaca'),\n famous_for=c('Battle of Arthemision', \"Homer's Odyssey\"),\n url=c('https://en.wikipedia.org/wiki/Battle_of_Artemisium', 'https://en.wikipedia.org/wiki/Ithaca'),\n year=c(-480,-800))\n\nhellas2 <- st_sf(data,\n crs=my_crs,\n geometry=st_sfc(pt2,pt3))\n\nnot_sparta <- rbind(hellas1, hellas2)\nnot_sparta\n",
opts = list(label = "\"prepared-objects\"", include = "FALSE"),
engine = "r"), list(label = "distex2", code = " not_sparta[st_nearest_feature(sparta,not_sparta),]",
opts = list(label = "\"distex2\"", exercise = "TRUE",
paged.print = "FALSE", exercise.setup = "\"prepared-objects\""),
engine = "r")), code_check = NULL, error_check = NULL,
check = NULL, solution = NULL, test_cases = NULL, options = list(
eval = FALSE, echo = TRUE, results = "markup", tidy = FALSE,
tidy.opts = NULL, collapse = FALSE, prompt = FALSE, comment = NA,
highlight = FALSE, size = "normalsize", background = "#F7F7F7",
strip.white = TRUE, cache = 0, cache.path = "tutorial-1-create-spatial-object_cache/html/",
cache.vars = NULL, cache.lazy = TRUE, dependson = NULL,
autodep = FALSE, cache.rebuild = FALSE, fig.keep = "high",
fig.show = "asis", fig.align = "default", fig.path = "tutorial-1-create-spatial-object_files/figure-html/",
dev = "png", dev.args = NULL, dpi = 192, fig.ext = "png",
fig.width = 6.5, fig.height = 4, fig.env = "figure",
fig.cap = NULL, fig.scap = NULL, fig.lp = "fig:", fig.subcap = NULL,
fig.pos = "", out.width = 624, out.height = NULL, out.extra = NULL,
fig.retina = 2, external = TRUE, sanitize = FALSE, interval = 1,
aniopts = "controls,loop", warning = TRUE, error = TRUE,
message = TRUE, render = NULL, ref.label = NULL, child = NULL,
engine = "r", split = FALSE, include = TRUE, purl = TRUE,
max.print = 1000, exercise.timelimit = 60, exercise.checker = "function (check_code, ...) \n{\n list(message = eval(parse(text = check_code)), correct = logical(0), \n type = \"info\", location = \"append\")\n}",
label = "distex2", exercise = TRUE, paged.print = FALSE,
exercise.setup = "prepared-objects", code = " not_sparta[st_nearest_feature(sparta,not_sparta),]",
out.width.px = 624, out.height.px = 384, params.src = " distex2, exercise = TRUE, paged.print=FALSE, exercise.setup = \"prepared-objects\"",
fig.num = 0, exercise.df_print = "paged"), engine = "r"), class = "tutorial_exercise"))
</script>
<!--html_preserve-->
<script type="application/shiny-prerendered" data-context="dependencies">
{"type":"list","attributes":{},"value":[{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["header-attrs"]},{"type":"character","attributes":{},"value":["2.13"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["rmd/h/pandoc"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["header-attrs.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["rmarkdown"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["2.13"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["jquery"]},{"type":"character","attributes":{},"value":["3.6.0"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["lib/3.6.0"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["jquery-3.6.0.min.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["jquerylib"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["0.1.4"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["bootstrap"]},{"type":"character","attributes":{},"value":["3.3.5"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["rmd/h/bootstrap"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["viewport"]}},"value":[{"type":"character","attributes":{},"value":["width=device-width, initial-scale=1"]}]},{"type":"character","attributes":{},"value":["js/bootstrap.min.js","shim/html5shiv.min.js","shim/respond.min.js"]},{"type":"character","attributes":{},"value":["css/cerulean.min.css"]},{"type":"character","attributes":{},"value":["<style>h1 {font-size: 34px;}\n h1.title {font-size: 38px;}\n h2 {font-size: 30px;}\n h3 {font-size: 24px;}\n h4 {font-size: 18px;}\n h5 {font-size: 16px;}\n h6 {font-size: 12px;}\n code {color: inherit; background-color: rgba(0, 0, 0, 0.04);}\n pre:not([class]) { background-color: white }<\/style>"]},{"type":"NULL"},{"type":"character","attributes":{},"value":["rmarkdown"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["2.13"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["pagedtable"]},{"type":"character","attributes":{},"value":["1.1"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["rmd/h/pagedtable-1.1"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["js/pagedtable.js"]},{"type":"character","attributes":{},"value":["css/pagedtable.css"]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["rmarkdown"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["2.13"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["highlightjs"]},{"type":"character","attributes":{},"value":["9.12.0"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["rmd/h/highlightjs"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["highlight.js"]},{"type":"character","attributes":{},"value":["textmate.css"]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["rmarkdown"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["2.13"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["tutorial"]},{"type":"character","attributes":{},"value":["0.10.1.9019"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["lib/tutorial"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["tutorial.js"]},{"type":"character","attributes":{},"value":["tutorial.css"]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["learnr"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["0.10.1.9019"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["i18n"]},{"type":"character","attributes":{},"value":["1.2.0"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["lib/i18n"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["i18next.min.js","tutorial-i18n-init.js"]},{"type":"NULL"},{"type":"character","attributes":{},"value":["<script id=\"i18n-cstm-trns\" type=\"application/json\">{\"language\":\"en\",\"resources\":{\"en\":{\"translation\":{\"button\":{\"runcode\":\"Run Code\",\"runcodetitle\":\"$t(button.runcode) ({{kbd}})\",\"hint\":\"Hint\",\"hint_plural\":\"Hints\",\"hinttitle\":\"$t(button.hint)\",\"hintnext\":\"Next Hint\",\"hintprev\":\"Previous Hint\",\"solution\":\"Solution\",\"solutiontitle\":\"$t(button.solution)\",\"copyclipboard\":\"Copy to Clipboard\",\"startover\":\"Start Over\",\"startovertitle\":\"$t(button.startover)\",\"continue\":\"Continue\",\"submitanswer\":\"Submit Answer\",\"submitanswertitle\":\"$t(button.submitanswer)\",\"previoustopic\":\"Previous Topic\",\"nexttopic\":\"Next Topic\",\"questionsubmit\":\"$t(button.submitanswer)\",\"questiontryagain\":\"Try Again\"},\"text\":{\"startover\":\"Start Over\",\"areyousure\":\"Are you sure you want to start over? (all exercise progress will be reset)\",\"youmustcomplete\":\"You must complete the\",\"exercise\":\"exercise\",\"exercise_plural\":\"exercises\",\"inthissection\":\"in this section before continuing.\",\"code\":\"Code\",\"enginecap\":\"{{engine}} $t(text.code)\",\"quiz\":\"Quiz\",\"blank\":\"blank\",\"blank_plural\":\"blanks\",\"exercisecontainsblank\":\"This exercise contains {{count}} $t(text.blank).\",\"pleasereplaceblank\":\"Please replace {{blank}} with valid code.\",\"unparsable\":\"It looks like this might not be valid R code. R cannot determine how to turn your text into a complete command. You may have forgotten to fill in a blank, to remove an underscore, to include a comma between arguments, or to close an opening <code>"<\\/code>, <code>'<\\/code>, <code>(<\\/code> or <code>{<\\/code> with a matching <code>"<\\/code>, <code>'<\\/code>, <code>)<\\/code> or <code>}<\\/code>.\\n\",\"unparsablequotes\":\"<p>It looks like your R code contains specially formatted quotation marks or "curly" quotes (<code>{{character}}<\\/code>) around character strings, making your code invalid. R requires character values to be contained in straight quotation marks (<code>"<\\/code> or <code>'<\\/code>).<\\/p> {{code}} <p>Don't worry, this is a common source of errors when you copy code from another app that applies its own formatting to text. You can try replacing the code on that line with the following. There may be other places that need to be fixed, too.<\\/p> {{suggestion}}\\n\",\"unparsableunicode\":\"<p>It looks like your R code contains an unexpected special character (<code>{{character}}<\\/code>) that makes your code invalid.<\\/p> {{code}} <p>Sometimes your code may contain a special character that looks like a regular character, especially if you copy and paste the code from another app. Try deleting the special character from your code and retyping it manually.<\\/p>\\n\",\"unparsableunicodesuggestion\":\"<p>It looks like your R code contains an unexpected special character (<code>{{character}}<\\/code>) that makes your code invalid.<\\/p> {{code}} <p>Sometimes your code may contain a special character that looks like a regular character, especially if you copy and paste the code from another app. You can try replacing the code on that line with the following. There may be other places that need to be fixed, too.<\\/p> {{suggestion}}\\n\",\"and\":\"and\",\"or\":\"or\",\"listcomma\":\", \",\"oxfordcomma\":\",\"}}},\"fr\":{\"translation\":{\"button\":{\"runcode\":\"Lancer le Code\",\"runcodetitle\":\"$t(button.runcode) ({{kbd}})\",\"hint\":\"Indication\",\"hint_plural\":\"Indications\",\"hinttitle\":\"$t(button.hint)\",\"hintnext\":\"Indication Suivante\",\"hintprev\":\"Indication Précédente\",\"solution\":\"Solution\",\"solutiontitle\":\"$t(button.solution)\",\"copyclipboard\":\"Copier dans le Presse-papier\",\"startover\":\"Recommencer\",\"startovertitle\":\"$t(button.startover)\",\"continue\":\"Continuer\",\"submitanswer\":\"Soumettre\",\"submitanswertitle\":\"$t(button.submitanswer)\",\"previoustopic\":\"Chapitre Précédent\",\"nexttopic\":\"Chapitre Suivant\",\"questionsubmit\":\"$t(button.submitanswer)\",\"questiontryagain\":\"Réessayer\"},\"text\":{\"startover\":\"Recommencer\",\"areyousure\":\"Êtes-vous certains de vouloir recommencer? (La progression sera remise à zéro)\",\"youmustcomplete\":\"Vous devez d'abord compléter\",\"exercise\":\"l'exercice\",\"exercise_plural\":\"des exercices\",\"inthissection\":\"de cette section avec de continuer.\",\"code\":\"Code\",\"enginecap\":\"$t(text.code) {{engine}}\",\"quiz\":\"Quiz\",\"and\":\"et\",\"or\":\"ou\",\"oxfordcomma\":\"\"}}},\"es\":{\"translation\":{\"button\":{\"runcode\":\"Ejecutar código\",\"runcodetitle\":\"$t(button.runcode) ({{kbd}})\",\"hint\":\"Pista\",\"hint_plural\":\"Pistas\",\"hinttitle\":\"$t(button.hint)\",\"hintnext\":\"Siguiente pista\",\"hintprev\":\"Pista anterior\",\"solution\":\"Solución\",\"solutiontitle\":\"$t(button.solution)\",\"copyclipboard\":\"Copiar al portapapeles\",\"startover\":\"Reiniciar\",\"startovertitle\":\"$t(button.startover)\",\"continue\":\"Continuar\",\"submitanswer\":\"Enviar respuesta\",\"submitanswertitle\":\"$t(button.submitanswer)\",\"previoustopic\":\"Tema anterior\",\"nexttopic\":\"Tema siguiente\",\"questionsubmit\":\"$t(button.submitanswer)\",\"questiontryagain\":\"Volver a intentar\"},\"text\":{\"startover\":\"Reiniciar\",\"areyousure\":\"¿De verdad quieres empezar de nuevo? (todo el progreso del ejercicio se perderá)\",\"youmustcomplete\":\"Debes completar\",\"exercise\":\"el ejercicio\",\"exercise_plural\":\"los ejercicios\",\"inthissection\":\"en esta sección antes de continuar.\",\"code\":\"Código\",\"enginecap\":\"$t(text.code) {{engine}}\",\"quiz\":\"Cuestionario\",\"and\":\"y\",\"or\":\"o\",\"oxfordcomma\":\"\"}}},\"pt\":{\"translation\":{\"button\":{\"runcode\":\"Executar código\",\"runcodetitle\":\"$t(button.runcode) ({{kbd}})\",\"hint\":\"Dica\",\"hint_plural\":\"Dicas\",\"hinttitle\":\"$t(button.hint)\",\"hintnext\":\"Próxima dica\",\"hintprev\":\"Dica anterior\",\"solution\":\"Solução\",\"solutiontitle\":\"$t(button.solution)\",\"copyclipboard\":\"Copiar para a área de transferência\",\"startover\":\"Reiniciar\",\"startovertitle\":\"$t(button.startover)\",\"continue\":\"Continuar\",\"submitanswer\":\"Enviar resposta\",\"submitanswertitle\":\"$t(button.submitanswer)\",\"previoustopic\":\"Tópico anterior\",\"nexttopic\":\"Próximo tópico\",\"questionsubmit\":\"$t(button.submitanswer)\",\"questiontryagain\":\"Tentar novamente\"},\"text\":{\"startover\":\"Reiniciar\",\"areyousure\":\"Tem certeza que deseja começar novamente? (todo o progresso feito será perdido)\",\"youmustcomplete\":\"Você deve completar\",\"exercise\":\"o exercício\",\"exercise_plural\":\"os exercícios\",\"inthissection\":\"nesta seção antes de continuar.\",\"code\":\"Código\",\"enginecap\":\"$t(text.code) {{engine}}\",\"quiz\":\"Quiz\",\"and\":\"e\",\"or\":\"ou\",\"oxfordcomma\":\"\"}}},\"tr\":{\"translation\":{\"button\":{\"runcode\":\"Çalıştırma Kodu\",\"runcodetitle\":\"$t(button.runcode) ({{kbd}})\",\"hint\":\"Ipucu\",\"hint_plural\":\"İpuçları\",\"hinttitle\":\"$t(button.hint)\",\"hintnext\":\"Sonraki İpucu\",\"hintprev\":\"Önceki İpucu\",\"solution\":\"Çözüm\",\"solutiontitle\":\"$t(button.solution)\",\"copyclipboard\":\"Pano'ya Kopyala\",\"startover\":\"Baştan Başlamak\",\"startovertitle\":\"$t(button.startover)\",\"continue\":\"Devam et\",\"submitanswer\":\"Cevabı onayla\",\"submitanswertitle\":\"$t(button.submitanswer)\",\"previoustopic\":\"Önceki Konu\",\"nexttopic\":\"Sonraki Konu\",\"questionsubmit\":\"$t(button.submitanswer)\",\"questiontryagain\":\"Tekrar Deneyin\"},\"text\":{\"startover\":\"Baştan Başlamak\",\"areyousure\":\"Baştan başlamak istediğinizden emin misiniz? (tüm egzersiz ilerlemesi kaybolacak)\",\"youmustcomplete\":\"Tamamlamalısın\",\"exercise\":\"egzersiz\",\"exercise_plural\":\"egzersizler\",\"inthissection\":\"devam etmeden önce bu bölümde\",\"code\":\"Kod\",\"enginecap\":\"$t(text.code) {{engine}}\",\"quiz\":\"Sınav\",\"oxfordcomma\":\"\"}}},\"emo\":{\"translation\":{\"button\":{\"runcode\":\"🏃\",\"runcodetitle\":\"$t(button.runcode) ({{kbd}})\",\"hint\":\"💡\",\"hint_plural\":\"$t(button.hint)\",\"hinttitle\":\"$t(button.hint)\",\"solution\":\"🎯\",\"solutiontitle\":\"$t(button.solution)\",\"copyclipboard\":\"📋\",\"startover\":\"⏮\",\"startovertitle\":\"Start Over\",\"continue\":\"✅\",\"submitanswer\":\"🆗\",\"submitanswertitle\":\"Submit Answer\",\"previoustopic\":\"⬅\",\"nexttopic\":\"➡\",\"questionsubmit\":\"$t(button.submitanswer)\",\"questiontryagain\":\"🔁\"},\"text\":{\"startover\":\"⏮\",\"areyousure\":\"🤔\",\"youmustcomplete\":\"⚠️ 👉 🧑💻\",\"exercise\":\"\",\"exercise_plural\":\"\",\"inthissection\":\"\",\"code\":\"💻\",\"enginecap\":\"$t(text.code) {{engine}}\",\"oxfordcomma\":\"\"}}},\"eu\":{\"translation\":{\"button\":{\"runcode\":\"Kodea egikaritu\",\"runcodetitle\":\"$t(button.runcode) ({{kbd}})\",\"hint\":\"Laguntza\",\"hint_plural\":\"Laguntza\",\"hinttitle\":\"$t(button.hint)\",\"hintnext\":\"Aurreko laguntza\",\"hintprev\":\"Hurrengo laguntza\",\"solution\":\"Ebazpena\",\"solutiontitle\":\"$t(button.solution)\",\"copyclipboard\":\"Arbelean kopiatu\",\"startover\":\"Berrabiarazi\",\"startovertitle\":\"$t(button.startover)\",\"continue\":\"Jarraitu\",\"submitanswer\":\"Erantzuna bidali\",\"submitanswertitle\":\"$t(button.submitanswer)\",\"previoustopic\":\"Aurreko atala\",\"nexttopic\":\"Hurrengo atala\",\"questionsubmit\":\"$t(button.submitanswer)\",\"questiontryagain\":\"Berriro saiatu\"},\"text\":{\"startover\":\"Berrabiarazi\",\"areyousure\":\"Berriro hasi nahi duzu? (egindako lana galdu egingo da)\",\"youmustcomplete\":\"Aurrera egin baino lehen atal honetako\",\"exercise\":\"ariketa egin behar duzu.\",\"exercise_plural\":\"ariketak egin behar dituzu.\",\"inthissection\":\"\",\"code\":\"Kodea\",\"enginecap\":\"$t(text.code) {{engine}}\",\"quiz\":\"Galdetegia\",\"oxfordcomma\":\"\"}}},\"de\":{\"translation\":{\"button\":{\"runcode\":\"Code ausführen\",\"runcodetitle\":\"$t(button.runcode) ({{kbd}})\",\"hint\":\"Tipp\",\"hint_plural\":\"Tipps\",\"hinttitle\":\"$t(button.hint)\",\"hintnext\":\"Nächster Tipp\",\"hintprev\":\"Vorheriger Tipp\",\"solution\":\"Lösung\",\"solutiontitle\":\"$t(button.solution)\",\"copyclipboard\":\"In die Zwischenablage kopieren\",\"startover\":\"Neustart\",\"startovertitle\":\"$t(button.startover)\",\"continue\":\"Weiter\",\"submitanswer\":\"Antwort einreichen\",\"submitanswertitle\":\"$t(button.submitanswer)\",\"previoustopic\":\"Vorheriges Kapitel\",\"nexttopic\":\"Nächstes Kapitel\",\"questionsubmit\":\"$t(button.submitanswer)\",\"questiontryagain\":\"Nochmal versuchen\"},\"text\":{\"startover\":\"Neustart\",\"areyousure\":\"Bist du sicher, dass du neustarten willst? (der gesamte Lernfortschritt wird gelöscht)\",\"youmustcomplete\":\"Vervollstädinge\",\"exercise\":\"die Übung\",\"exercise_plural\":\"die Übungen\",\"inthissection\":\"in diesem Kapitel, bevor du fortfährst.\",\"code\":\"Code\",\"enginecap\":\"$t(text.code) {{engine}}\",\"quiz\":\"Quiz\",\"blank\":\"Lücke\",\"blank_plural\":\"Lücken\",\"pleasereplaceblank\":\"Bitte ersetze {{blank}} mit gültigem Code.\",\"unparsable\":\"Dies scheint kein gültiger R Code zu sein. R kann deinen Text nicht in einen gültigen Befehl übersetzen. Du hast vielleicht vergessen, die Lücke zu füllen, einen Unterstrich zu entfernen, ein Komma zwischen Argumente zu setzen oder ein eröffnendes <code>"<\\/code>, <code>'<\\/code>, <code>(<\\/code> oder <code>{<\\/code> mit einem zugehörigen <code>"<\\/code>, <code>'<\\/code>, <code>)<\\/code> oder <code>}<\\/code> zu schließen.\\n\",\"and\":\"und\",\"or\":\"oder\",\"listcomma\":\", \",\"oxfordcomma\":\",\"}}},\"ko\":{\"translation\":{\"button\":{\"runcode\":\"코드 실행\",\"runcodetitle\":\"$t(button.runcode) ({{kbd}})\",\"hint\":\"힌트\",\"hint_plural\":\"힌트들\",\"hinttitle\":\"$t(button.hint)\",\"hintnext\":\"다음 힌트\",\"hintprev\":\"이전 힌트\",\"solution\":\"솔루션\",\"solutiontitle\":\"$t(button.solution)\",\"copyclipboard\":\"클립보드에 복사\",\"startover\":\"재학습\",\"startovertitle\":\"$t(button.startover)\",\"continue\":\"다음 학습으로\",\"submitanswer\":\"정답 제출\",\"submitanswertitle\":\"$t(button.submitanswer)\",\"previoustopic\":\"이전 토픽\",\"nexttopic\":\"다음 토픽\",\"questionsubmit\":\"$t(button.submitanswer)\",\"questiontryagain\":\"재시도\"},\"text\":{\"startover\":\"재학습\",\"areyousure\":\"다시 시작 하시겠습니까? (모든 예제의 진행 정보가 재설정됩니다)\",\"youmustcomplete\":\"당신은 완료해야 합니다\",\"exercise\":\"연습문제\",\"exercise_plural\":\"연습문제들\",\"inthissection\":\"이 섹션을 실행하기 전에\",\"code\":\"코드\",\"enginecap\":\"$t(text.code) {{engine}}\",\"quiz\":\"퀴즈\",\"blank\":\"공백\",\"blank_plural\":\"공백들\",\"exercisecontainsblank\":\"이 연습문제에는 {{count}}개의 $t(text.blank)이 포함되어 있습니다.\",\"pleasereplaceblank\":\"{{blank}}를 유효한 코드로 바꾸십시오.\",\"unparsable\":\"이것은 유효한 R 코드가 아닐 수 있습니다. R은 텍스트를 완전한 명령으로 변환하는 방법을 결정할 수 없습니다. 당신은 공백이나 밑줄을 대체하여 채우기, 인수를 컴마로 구분하기, 또는 <code>"<\\/code>, <code>'<\\/code>, <code>(<\\/code> , <code>{<\\/code>로 시작하는 구문을 닫는 <code>"<\\/code>, <code>'<\\/code>, <code>)<\\/code>, <code>}<\\/code>을 잊었을 수도 있습니다.\\n\",\"and\":\"그리고\",\"or\":\"혹은\",\"listcomma\":\", \",\"oxfordcomma\":\"\"}}}}}<\/script>"]},{"type":"NULL"},{"type":"character","attributes":{},"value":["learnr"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["0.10.1.9019"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["tutorial-format"]},{"type":"character","attributes":{},"value":["0.10.1.9019"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["rmarkdown/templates/tutorial/resources"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["tutorial-format.js"]},{"type":"character","attributes":{},"value":["tutorial-format.css","rstudio-theme.css"]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["learnr"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["0.10.1.9019"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["jquery"]},{"type":"character","attributes":{},"value":["3.6.0"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["lib/3.6.0"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["jquery-3.6.0.min.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["jquerylib"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["0.1.4"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["navigation"]},{"type":"character","attributes":{},"value":["1.1"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["rmd/h/navigation-1.1"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["tabsets.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["rmarkdown"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["2.13"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["highlightjs"]},{"type":"character","attributes":{},"value":["9.12.0"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["rmd/h/highlightjs"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["highlight.js"]},{"type":"character","attributes":{},"value":["default.css"]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["rmarkdown"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["2.13"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["jquery"]},{"type":"character","attributes":{},"value":["3.6.0"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["lib/3.6.0"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["jquery-3.6.0.min.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["jquerylib"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["0.1.4"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["font-awesome"]},{"type":"character","attributes":{},"value":["5.1.0"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["rmd/h/fontawesome"]}]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["css/all.css","css/v4-shims.css"]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["rmarkdown"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["2.13"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["bootbox"]},{"type":"character","attributes":{},"value":["4.4.0"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["lib/bootbox"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["bootbox.min.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["learnr"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["0.10.1.9019"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["idb-keyvalue"]},{"type":"character","attributes":{},"value":["3.2.0"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["lib/idb-keyval"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["idb-keyval-iife-compat.min.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["learnr"]},{"type":"logical","attributes":{},"value":[false]},{"type":"character","attributes":{},"value":["0.10.1.9019"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["tutorial"]},{"type":"character","attributes":{},"value":["0.10.1.9019"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["lib/tutorial"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["tutorial.js"]},{"type":"character","attributes":{},"value":["tutorial.css"]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["learnr"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["0.10.1.9019"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["ace"]},{"type":"character","attributes":{},"value":["1.2.6"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["lib/ace"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["ace.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["learnr"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["0.10.1.9019"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["clipboardjs"]},{"type":"character","attributes":{},"value":["1.5.15"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["lib/clipboardjs"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["clipboard.min.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["learnr"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["0.10.1.9019"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["ace"]},{"type":"character","attributes":{},"value":["1.2.6"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["lib/ace"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["ace.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["learnr"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["0.10.1.9019"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["clipboardjs"]},{"type":"character","attributes":{},"value":["1.5.15"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["lib/clipboardjs"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["clipboard.min.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["learnr"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["0.10.1.9019"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["ace"]},{"type":"character","attributes":{},"value":["1.2.6"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["lib/ace"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["ace.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["learnr"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["0.10.1.9019"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["clipboardjs"]},{"type":"character","attributes":{},"value":["1.5.15"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["lib/clipboardjs"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["clipboard.min.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["learnr"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["0.10.1.9019"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["ace"]},{"type":"character","attributes":{},"value":["1.2.6"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["lib/ace"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["ace.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["learnr"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["0.10.1.9019"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["clipboardjs"]},{"type":"character","attributes":{},"value":["1.5.15"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["lib/clipboardjs"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["clipboard.min.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["learnr"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["0.10.1.9019"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["ace"]},{"type":"character","attributes":{},"value":["1.2.6"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["lib/ace"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["ace.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["learnr"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["0.10.1.9019"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["clipboardjs"]},{"type":"character","attributes":{},"value":["1.5.15"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["lib/clipboardjs"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["clipboard.min.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["learnr"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["0.10.1.9019"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets"]},{"type":"character","attributes":{},"value":["1.5.4"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["www"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["htmlwidgets.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["htmlwidgets"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["1.5.4"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["jquery"]},{"type":"character","attributes":{},"value":["1.12.4"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets/lib/jquery"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["jquery.min.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["2.1.1"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["leaflet"]},{"type":"character","attributes":{},"value":["1.3.1"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets/lib/leaflet"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet.js"]},{"type":"character","attributes":{},"value":["leaflet.css"]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["2.1.1"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["leafletfix"]},{"type":"character","attributes":{},"value":["1.0.0"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets/lib/leafletfix"]}]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["leafletfix.css"]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["2.1.1"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["proj4"]},{"type":"character","attributes":{},"value":["2.6.2"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets/plugins/Proj4Leaflet"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["proj4.min.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet"]},{"type":"logical","attributes":{},"value":[false]},{"type":"character","attributes":{},"value":["2.1.1"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["Proj4Leaflet"]},{"type":"character","attributes":{},"value":["1.0.1"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets/plugins/Proj4Leaflet"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["proj4leaflet.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet"]},{"type":"logical","attributes":{},"value":[false]},{"type":"character","attributes":{},"value":["2.1.1"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["rstudio_leaflet"]},{"type":"character","attributes":{},"value":["1.3.1"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets/lib/rstudio_leaflet"]}]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["rstudio_leaflet.css"]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["2.1.1"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["leaflet-binding"]},{"type":"character","attributes":{},"value":["2.1.1"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet"]},{"type":"logical","attributes":{},"value":[false]},{"type":"character","attributes":{},"value":["2.1.1"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["leaflet-providers"]},{"type":"character","attributes":{},"value":["1.9.0"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["href"]}},"value":[{"type":"character","attributes":{},"value":["tutorial-1-create-spatial-object_files/leaflet-providers-1.9.0"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet-providers_1.9.0.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"logical","attributes":{},"value":[false]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["leaflet-providers-plugin"]},{"type":"character","attributes":{},"value":["2.1.1"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets/plugins/leaflet-providers-plugin"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet-providers-plugin.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["2.1.1"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["HomeButton"]},{"type":"character","attributes":{},"value":["0.0.1"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets/lib/HomeButton"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["home-button.js","easy-button-src.min.js"]},{"type":"character","attributes":{},"value":["home-button.css"]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["leafem"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["0.1.6"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["clipboard"]},{"type":"character","attributes":{},"value":["0.0.1"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets/lib/clipboard"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["setClipboardText.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["leafem"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["0.1.6"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["mapviewCSS"]},{"type":"character","attributes":{},"value":["0.0.1"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets/lib/css"]}]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["mapview-popup.css","mapview.css"]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["mapview"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["2.10.0"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets"]},{"type":"character","attributes":{},"value":["1.5.4"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["www"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["htmlwidgets.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["htmlwidgets"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["1.5.4"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["jquery"]},{"type":"character","attributes":{},"value":["1.12.4"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets/lib/jquery"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["jquery.min.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["2.1.1"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["leaflet"]},{"type":"character","attributes":{},"value":["1.3.1"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets/lib/leaflet"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet.js"]},{"type":"character","attributes":{},"value":["leaflet.css"]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["2.1.1"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["leafletfix"]},{"type":"character","attributes":{},"value":["1.0.0"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets/lib/leafletfix"]}]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["leafletfix.css"]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["2.1.1"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["proj4"]},{"type":"character","attributes":{},"value":["2.6.2"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets/plugins/Proj4Leaflet"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["proj4.min.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet"]},{"type":"logical","attributes":{},"value":[false]},{"type":"character","attributes":{},"value":["2.1.1"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["Proj4Leaflet"]},{"type":"character","attributes":{},"value":["1.0.1"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets/plugins/Proj4Leaflet"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["proj4leaflet.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet"]},{"type":"logical","attributes":{},"value":[false]},{"type":"character","attributes":{},"value":["2.1.1"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["rstudio_leaflet"]},{"type":"character","attributes":{},"value":["1.3.1"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets/lib/rstudio_leaflet"]}]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["rstudio_leaflet.css"]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["2.1.1"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["leaflet-binding"]},{"type":"character","attributes":{},"value":["2.1.1"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet"]},{"type":"logical","attributes":{},"value":[false]},{"type":"character","attributes":{},"value":["2.1.1"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["leaflet-providers"]},{"type":"character","attributes":{},"value":["1.9.0"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["href"]}},"value":[{"type":"character","attributes":{},"value":["tutorial-1-create-spatial-object_files/leaflet-providers-1.9.0"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet-providers_1.9.0.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"logical","attributes":{},"value":[false]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["leaflet-providers-plugin"]},{"type":"character","attributes":{},"value":["2.1.1"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets/plugins/leaflet-providers-plugin"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet-providers-plugin.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["leaflet"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["2.1.1"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["HomeButton"]},{"type":"character","attributes":{},"value":["0.0.1"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets/lib/HomeButton"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["home-button.js","easy-button-src.min.js"]},{"type":"character","attributes":{},"value":["home-button.css"]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["leafem"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["0.1.6"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["clipboard"]},{"type":"character","attributes":{},"value":["0.0.1"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets/lib/clipboard"]}]},{"type":"NULL"},{"type":"character","attributes":{},"value":["setClipboardText.js"]},{"type":"NULL"},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["leafem"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["0.1.6"]}]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","version","src","meta","script","stylesheet","head","attachment","package","all_files","pkgVersion"]},"class":{"type":"character","attributes":{},"value":["html_dependency"]}},"value":[{"type":"character","attributes":{},"value":["mapviewCSS"]},{"type":"character","attributes":{},"value":["0.0.1"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["file"]}},"value":[{"type":"character","attributes":{},"value":["htmlwidgets/lib/css"]}]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["mapview-popup.css","mapview.css"]},{"type":"NULL"},{"type":"NULL"},{"type":"character","attributes":{},"value":["mapview"]},{"type":"logical","attributes":{},"value":[true]},{"type":"character","attributes":{},"value":["2.10.0"]}]}]}
</script>
<!--/html_preserve-->
<!--html_preserve-->
<script type="application/shiny-prerendered" data-context="execution_dependencies">
{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["packages"]}},"value":[{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["packages","version"]},"class":{"type":"character","attributes":{},"value":["data.frame"]},"row.names":{"type":"integer","attributes":{},"value":[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]}},"value":[{"type":"character","attributes":{},"value":["assertthat","backports","base","base64enc","brew","bslib","checkmate","class","classInt","cli","codetools","colorspace","compiler","crayon","crosstalk","curl","datasets","DBI","digest","dplyr","e1071","ellipsis","evaluate","fansi","fastmap","generics","glue","graphics","grDevices","grid","htmltools","htmlwidgets","httpuv","jquerylib","jsonlite","KernSmooth","knitr","later","lattice","leafem","leaflet","leaflet.providers","leafpop","learnr","lifecycle","magrittr","mapview","markdown","methods","mime","munsell","pillar","pkgconfig","png","promises","proxy","purrr","R6","raster","RColorBrewer","Rcpp","rlang","rmarkdown","rprojroot","rstudioapi","sass","satellite","scales","sf","shiny","sp","stats","stats4","stringi","stringr","svglite","systemfonts","terra","tibble","tidyselect","tools","units","utf8","utils","uuid","vctrs","webshot","withr","xfun","xtable","yaml"]},{"type":"character","attributes":{},"value":["0.2.1","1.4.1","4.1.0","0.1-3","1.0-6","0.3.1","2.0.0","7.3-19","0.4-3","3.2.0","0.2-18","2.0-3","4.1.0","1.5.1","1.2.0","4.3.2","4.1.0","1.1.2","0.6.29","1.0.7","1.7-9","0.3.2","0.15","1.0.3","1.1.0","0.1.1","1.6.2","4.1.0","4.1.0","4.1.0","0.5.2","1.5.4","1.6.5","0.1.4","1.8.0","2.23-20","1.37","1.3.0","0.20-45","0.1.6","2.1.1","1.9.0","0.1.0","0.10.1.9019","1.0.1","2.0.3","2.10.0","1.1","4.1.0","0.12","0.5.0","1.7.0","2.0.3","0.1-7","1.2.0.1","0.4-26","0.3.4","2.5.1","3.5-15","1.1-3","1.0.8.3","1.0.2","2.13","2.0.2","0.13","0.4.0","1.0.4","1.1.1","1.0-7","1.7.1","1.4-6","4.1.0","4.1.0","1.7.6","1.4.0","2.0.0","1.0.3","1.5-21","3.1.6","1.1.1","4.1.0","0.8-0","1.2.2","4.1.0","1.0-3","0.4.0","0.5.2","2.5.0","0.30","1.8-4","2.3.5"]}]}]}
</script>
<!--/html_preserve-->
</div>
</div>
</div> <!-- topics -->
<div class="topicsContainer">
<div class="topicsPositioner">
<div class="band">
<div class="bandContent topicsListContainer">
<!-- begin doc-metadata -->
<div id="doc-metadata">
<h2 class="title toc-ignore" style="display:none;">Geo-spatial tutorial: create a simple feature</h2>
<h4 class="author"><em>JR Ferrer-Paris</em></h4>
<h4 class="date"><em>March 2021 (updated: 2022-04-04)</em></h4>
</div>
<!-- end doc-metadata -->
</div> <!-- bandContent.topicsListContainer -->
</div> <!-- band -->
</div> <!-- topicsPositioner -->
</div> <!-- topicsContainer -->
</div> <!-- bandContent page -->
</div> <!-- pageContent band -->
<!-- Build Tabsets -->
<script>
$(document).ready(function () {
window.buildTabsets("section-TOC");
});
$(document).ready(function () {
$('.tabset-dropdown > .nav-tabs > li').click(function () {
$(this).parent().toggleClass('nav-tabs-open')
});
});
</script>
<script>
// add bootstrap table styles to pandoc tables
function bootstrapStylePandocTables() {
$('tr.header').parent('thead').parent('table').addClass('table table-condensed');
}
$(document).ready(function () {
bootstrapStylePandocTables();
});
</script>
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
</body>
</html>