forked from r-in-grenoble/r-in-grenoble.github.io
-
Notifications
You must be signed in to change notification settings - Fork 4
/
members.Rmd
124 lines (104 loc) · 4.78 KB
/
members.Rmd
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
---
title: "Presenters"
output:
html_document:
includes:
in_header: header.html
editor_options:
chunk_output_type: console
---
```{r, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning=FALSE, error = FALSE, message = FALSE)
library(dplyr)
# devtools::install_github("privefl/googlesheets")
library(googlesheets)
# install.packages(c("leaflet", "DT"))
library(leaflet)
library(DT)
```
```{r, include=FALSE, fig.width=25}
# install.packages("gh")
# library(gh)
members<-data.frame("Name" = c("Aaron Mamula", "Emily Markowitz", "Erin Steiner",
"Rob Ames", "Ben Fissel", "Geret Depiper",
"Allen Chen"),
"First Name" = c("Aaron", "Emily", "Erin", "Rob", "Ben", "Geret", "Allen"),
"Last Name" = c("Mamula", "Markowitz", "Steiner", "Ames", "Fissel", "Depiper", "Chen"),
"github" = c("aaronmams", "emilyhmarkowitz", "erinsteiner-NOAA",
"", "", "gdepiper",
"allen-chen-noaa-gov"),
"lat" = c(36.956806, 41.197558, 47.640816,
45.510209, 47.640816, 41.526796,
47.640816),
"lon" = c(-122.021390, -73.897447, -122.336197,
-122.669898, -122.3361978, -70.675144,
-122.336197),
"Institution" = c("Southwest Fisheries Science Center",
"Office of Science and Technology/Alaska Fisheries Science Center",
"Northwest Fisheries Science Center",
"Pacific States Marine Fisheries Commission",
"Alaska Fisheries Science Center",
"Northeast Fisheries Science Center",
"Northwest Fisheries Science Center"))
members$imagelink<-members$githublink<-NA
members$Status<-"Presenter"
for (i in 1:nrow(members)) {
# if (!(members$github[i] %in% "")) {
members$githublink[i]<-paste0("https://github.com/", members$github[i])
members$imagelink[i]<-paste0("./images/", gsub(pattern = " ", replacement = "",
x = members$Name[i]), ".png")
# } else {
# members$githublink[i]<-paste0("https://github.com/")
# members$imagelink[i]<-paste0("./images/noaa_logo.gif")
# }
# my_repos <- gh("GET /users/emilyhmarkowitz/repos")
# vapply(my_repos, "[[", "", "name")
}
members$GitHub<-members$githublink
members$Website<-members$githublink
membersgit<-members[!(members$github %in% ""),]
membersnogit<-members[(members$github %in% ""),]
library(glue)
membersgit<-as_tibble(membersgit)
print0<-glue_data(.x = membersgit, .sep = "",
'
![{githublink}]({imagelink})')
```
```{r}
# m <- leaflet() %>%
# addTiles() %>% # Add default OpenStreetMap map tiles
# addMarkers(lng=174.768, lat=-36.852, popup="The birthplace of R")
library(leafpop)
library(maps)
mapStates = map("state", fill = TRUE, plot = FALSE)
# leaflet(data = mapStates) %>%
leaflet() %>%
addTiles() %>%
# addPolygons(fillColor = topo.colors(10, alpha = NULL), stroke = FALSE) %>%
addMarkers(lng=members$lon, lat=members$lat, group = "points",
popup=paste("<b>", members$Name, "</b>
<br/> ", members$Institution,
"<br/> ", ifelse(members$github %in% "", "",
paste0("<a href = ", members$GitHub, "> GitHub </a> "))))
# addMarkers(lng=membersnogit$lon, lat=membersnogit$lat, group = "points",
# popup=paste("<b>", membersnogit$Name, "</b>
# <br/> ", membersnogit$Institution,
# "<br/> ", ifelse(membersnogit$github %in% "", "",
# paste0("<a href = ", membersnogit$GitHub, "> GitHub </a> ")))) %>%
#
# addMarkers(lng=membersgit$lon, lat=membersgit$lat, group = "withgit",
# popup=paste("<b>", membersgit$Name, "</b>
# <br/> ", membersgit$Institution,
# "<br/> ", ifelse(membersgit$github %in% "", "",
# paste0("<a href = ", membersgit$GitHub, "> GitHub </a> ")))) %>%
#
# addPopupImages(image = membersgit$imagelink, group = "withgit", width = 300, height = 350)#width = 2*(300*2), height = 2*(350/8))
# vwidth = 300, vheight = 350
```
```{r}
# display table
members$GitHub[members$GitHub %in% "https://github.com/"]<-""
datatable(select(members, c(Name, Institution, GitHub)),
rownames = FALSE, escape = FALSE, options = list(dom = 't'))
```
# `r print0 `