plot.semnar: Interactive 'semnar' maps

View source: R/plot.R

plot.semnarR Documentation

Interactive semnar maps

Description

Interactive semnar maps

Usage

## S3 method for class 'semnar'
plot(
  x,
  group = "city",
  title = NA,
  title_position = "bottomleft",
  provider = "OpenStreetMap.Mapnik",
  interval = TRUE,
  date_format = "dmy",
  shorten_url = FALSE,
  service = "Is.gd",
  width = NULL,
  height = NULL,
  show_event_url = FALSE,
  opacity = 0.2,
  past_year_colour = "#737373",
  this_year_colour = "#ef3b2c",
  ...
)

Arguments

x

an object of class semnar. See add_presentation().

group

according to what should the semnars be selected on the map? Available options are "none", "year", "month", "presenter", "event", "country", "city" (default), "year+country".

title

character string for the title of the map. Default is NA, which produces no title.

title_position

the position of the title on the map, if title is not NA. Available options are "bottomleft" (default), "bottomright", "topleft", "topright".

provider

the provider of tiles for the base map. See leaflet::addProviderTiles(). Default is "OpenStreetMap.Mapnik".

interval

Should the start and end times in each popup be displayed as an interval (TRUE; default) or in two separate lines (FALSE)?

date_format

In what format should the dates be displayed? Available options are "dmy", "mdy", "ydm", "ymd", where "y" stands for year, "m" stands for month, and "d" stands for day.

shorten_url

Should the URL links in "object$link" be shortened? Default is FALSE.

service

service to use for shortening URLs. Current options are "Is.gd" (default) and "V.gd". See shorten_url().

width

As in leaflet::leaflet(). Default is NULL.

height

As in leaflet::leaflet(). Default is NULL.

show_event_url

Should the event or talk/seminar URL ("link" argument in add_presentation()) be printed in the popups (TRUE), or the event name ("event" argument in add_presentation()) become a hyperlink pointing to the event or talk/seminar URL (FALSE; default).

opacity

As in leaflet::markerOptions(). Default is 0.2.

past_year_colour

Colour to be used for past year's presentations. Default is "#ef3b2c". See Details.

this_year_colour

Colour to be used for this year's presentations. Default is "#737373". See Details.

...

Arguments to be passed to other methods. Currently unused.

Value

An interactive map (opens in browser) with the locations of the events. When the locations are clicked, pup-ups appear which give access to event details. A legend with the colour-year combination is printed only if this_year_colour != past_year_colour. The current year is determined by lubridate::year(Sys.time()).

See Also

add_presentation()

Examples

out <- add_presentation(country = "England", city = "Coventry",
                        lon = -1.560843, lat = 52.384019,
                        event = "Young Researchers' Meeting",
                        title = "A workflow that most probably isn't yours",
                        link = "https://warwick.ac.uk/fac/sci/statistics/news/yrm/",
                        materials = "https://ikosmidis.com/files/ikosmidis_YRM_2019.pdf",
                        type = "presentation", institution = "University of Warwick",
                        department = "Department of Statistics",
                        venue = "Mathematical Sciences Building", room = "M1.02",
                        year = 2019, month = 5, day = 28,
                        start_hour = 16, start_min = 00,
                        end_hour = 17, end_min = 00) |>
        add_presentation(country = "United States", city = "Stanford",
                         lon = -122.165330, lat = 37.429464,
                         event = "useR! 2016",
                         title = "brglm: Reduced-bias inference in generalized linear models",
                         link = "https://user2016.r-project.org//files/abs-book.pdf",
                         materials = "https://bit.ly/2KCBbKg",
                         type = "presentation", institution = NA, department = NA,
                         venue = "Stanford Institute for Economic Policy Research",
                         room = "Siepr 120",
                         year = 2016, month = 06, day = 29,
                         start_hour = 14, start_min = 15,
                         end_hour = 14, end_min = 35)
if (interactive()) {
  plot(out, group = "city",
       title = "<a href='https://cran.r-project.org/package=semnar'>semnar</a> map")
}

semnar documentation built on Nov. 3, 2022, 5:06 p.m.