Adjust size of leaflet map in rmarkdown html

This works fine:

SomeData %>% 
  leaflet(height=2000, width=2000) %>% 
  addTiles() %>% 
  addMarkers(clusterOption=markerClusterOptions())

Here SomeData is a dataframe containing columns: Lat and Long.


I found that changing fig.width and fig.height did not change the size of my leaflet maps. However, changing a different parameter/option did.

Try changing the width/height using this in the header for the code chunk:

{r, width = 40, height = 30}

Or alternatively, another thing that has worked for me is to use this (in this case, do not put anything in the chunk header:

m <- leaflet(width = "100%") %>%