Last active
September 18, 2016 20:53
-
-
Save tiernanmartin/0fd957e0a22cfa533886c35b8a2e9e0d to your computer and use it in GitHub Desktop.
An example of showing a desired arrangement for html widgets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "R Notebook" | |
output: | |
pdf_document: default | |
html_notebook: default | |
--- | |
###Default Arrangement | |
```{r, echo=FALSE,message=FALSE} | |
# devtools::install_github("wch/webshot") | |
library(leaflet) | |
library(htmltools) | |
library(RColorBrewer) | |
m1 <- leaflet(quakes) %>% | |
addTiles() %>% | |
addMarkers(lng=174.768, lat=-36.852) | |
m2 <- leaflet(quakes) %>% | |
addProviderTiles("Esri.WorldGrayCanvas") %>% | |
addMarkers(lng=174.768, lat=-36.852) | |
m3 <- leaflet(quakes) %>% | |
addProviderTiles("Stamen.Toner") %>% | |
addMarkers(lng=174.768, lat=-36.852) | |
m1 | |
m2 | |
m3 | |
``` | |
###HTML Arrangement | |
```{r, echo=FALSE,message=FALSE} | |
browsable( | |
tagList(list( | |
tags$div( | |
style = 'width:30%;display:block;float:left;padding:3px;', | |
m1 | |
), | |
tags$div( | |
style = 'width:30%;display:block;float:left;padding:3px;', | |
m2 | |
), | |
tags$div( | |
style = 'width:30%;display:block;float:left;padding:3px;', | |
m3 | |
) | |
)) | |
) | |
``` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment