R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

# Load the leaflet library
library(leaflet)

# Create the Leaflet map with markers
Urlaub <- leaflet() %>%
  addTiles() %>%
  addMarkers(lng = 80.3319, lat = 26.4499, popup = "Kanpur, India") %>%
  addMarkers(lng = 74.7421, lat = 13.3409, popup = "Udupi, India") %>%
  addMarkers(lng = 85.1376, lat = 25.5941, popup = "Patna, India") %>%
  addMarkers(lng = 76.7794, lat = 30.7333, popup = "Chandigarh, India") %>%
  addMarkers(lng = 77.5946, lat = 12.9716, popup = "Bangalore, India")

# Display the map
Urlaub

Explanation of the code:

  • title, author, and date: These fields define the document’s metadata, and date is set to display the current date automatically.
  • The library(leaflet) line loads the required leaflet library.
  • The Urlaub object creates a Leaflet map, with addTiles() to set the map background and addMarkers() to add specific locations.
  • message=FALSE and warning=FALSE prevent unnecessary messages and warnings from displaying in the output.

After knitting the document to HTML, you should see an interactive Leaflet map with the specified cities in India. This document should then be ready for publishing on RPubs. Let me know if this solves the issue or if you need further assistance.

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.