#Temp12k1_0_0
---
title: "Temp12k1_0_0"
output:
flexdashboard::flex_dashboard:
vertical_layout: scroll
theme: bootstrap
source_code: embed
orientation: rows
---
```{r setup, include = FALSE}
library(flexdashboard)
library(maptools)
library(tidyverse)
library(purrr)
library(leaflet)
library(plotly)
library(lipdR)
library(dygraphs)
library(geoChronR)
library(lipdverseR)
#read functions
load("../../temp.Rdata")
load("../../chronTemp.Rdata")
#remove columns we don't want to plot
varNames <- sapply(TS, "[[","paleoData_variableName")
# good <- which(!(varNames %in% c("year","depth","age")))
# TS <- TS[good]
#All datasets
dsn <- lipdR::pullTsVariable(TS,"dataSetName")
ui <- which(!duplicated(dsn))
udsn <- dsn[ui]
lat <- lipdR::pullTsVariable(TS,"geo_latitude")[ui]
lon <- lipdR::pullTsVariable(TS,"geo_longitude")[ui]
elev <- lipdR::pullTsVariable(TS,"geo_elevation")[ui]
archiveType <- lipdR::pullTsVariable(TS,"archiveType")[ui]
link <- paste0(udsn,".html") %>%
str_replace_all("'","_")
#Organize metadata for map
map.meta <- data.frame(dataSetName = udsn, #datasetname
lat = lat,#lat
lon = lon,#lon
# elev = elev,#elevation
archiveType = factor(archiveType),#archiveType
link = link)#Link
#set index number
i = 1
```
#Temp12k1_0_0
Metadata {.sidebar}
-------------------------------------
[Download all LiPD files for Temp12k1_0_0](Temp12k1_0_0.zip)
[Download R serialization of all LiPD files for Temp12k1_0_0](Temp12k1_0_0.RData)
[Download matlab serialization of all LiPD files for Temp12k1_0_0](Temp12k1_0_0.mat)
[Download python (pickle) serialization of all LiPD files for Temp12k1_0_0](Temp12k1_0_0.pkl)
[Report an issue (include project name)](https://github.com/nickmckay/LiPDverse/issues)
[View changelog for Temp12k1_0_0](metadataChangelog.html)
***
Information and links to compilation publications and long-term archival at [lipdverse.org](http://lipdverse.org) main page
Row {.tabset .tabset-fade}
-----------------------------------------------------------------------
### Sitemap
```{r}
map.meta.split <- split(map.meta, map.meta$archiveType)
factpal <- colorFactor("Paired",map.meta$archiveType)
buff <- 60
l <- leaflet() %>%
addTiles() %>%
fitBounds(map.meta$lon[i]-buff,map.meta$lat[i]-buff,map.meta$lon[i]+buff,map.meta$lat[i]+buff)
names(map.meta.split) %>%
purrr::walk( function(df) {
l <<- l %>%
addMarkers(data=map.meta.split[[df]],
lng=~lon, lat=~lat,
label=~as.character(archiveType),
popup=~paste(str_c('Dataset: ',dataSetName,''),
# str_c("Elevation: ",elev),
str_c("Archive Type: ",archiveType),
sep = "
"),
group = df,
clusterOptions = markerClusterOptions(removeOutsideVisibleBounds = F),
labelOptions = labelOptions(noHide = F,
direction = 'auto'))
})
l <- l %>% addCircleMarkers(lng = map.meta$lon[i], lat = map.meta$lat[i],radius = 20,color = "red",fillColor = "none")
l %>%
addLayersControl(position = "bottomleft",
overlayGroups = names(map.meta.split),
options = layersControlOptions(collapsed = FALSE,
opacity = 0.8)
)
```
### Search the LiPDverse (Beta! doesn't work well yet)
```{r}
#Add google search bar
htmltools::includeHTML("../../googleSearchChunk.html")
```