```{r setup, message=FALSE} # key setups library(sqldf) # to use sql syntax with data frames library(knitr) # knitr for kable tables library(kableExtra) # pretty tables library(sf) # simple features (GIS) library(leaflet) # nice maps library(tools) # md5sum # captions library(captioner) table_nums <- captioner(prefix = "Table") figure_nums <- captioner(prefix = "Figure") # for having DIV tags knitr::knit_hooks$set(class = function(before, options, envir) { if(before){ sprintf("
", options$class) }else{ "
" } }) knitr::opts_chunk$set(warning = FALSE, message = FALSE) ``` # Introduction # Methods ## Data ## Analysis # Results ## A table See `r table_nums(name = "tcap0", display = "cite")` _`r table_nums(name = "tcap0", caption = "My caption")`_ ```{r} irishead <- head(iris) kable(irishead, format = "html") %>% kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"), full_width = F, position = "left") ``` ## A leaflet map See _`r figure_nums(name = "spaceneedle", display = "cite")`_ ```{r} # the Space Needle snxy <- data.frame(name = "Space Needle", x = -122.3493, y = 47.6205) space_needle <- st_as_sf(snxy, coords = c("x", "y"), crs = 4326) # a leaflet m <- leaflet() %>% addTiles() %>% addCircleMarkers(data = space_needle) m ``` \ _`r figure_nums(name = "spaceneedle", caption = "A simple leaflet map with the Space Needle as a markerpoint")`_ ## A figure with black outlines An image is shown below (`r figure_nums(name = "csdelogo", display = "cite")`).
![](https://csde.washington.edu/wp-content/uploads/2016/08/csdelogo-110x110.png)
\ _`r figure_nums(name = "csdelogo", caption = "CSDE Logo")`_ # Discussion # Conclusions # Source code ## This document ```{r comment=''} cat(readLines("//udrive.uw.edu/udrive/csde502_winter_2021/week_01.Rmd"), sep = '\n') ```