0
https://rstudio.github.io/leaflet/popups.htmlの最初の例をエミュレートしようとしていますが、htmlタグのベクトルではなく1つのベクトルをエミュレートしようとしています。 https://rstudio.github.io/leaflet/popups.html上R、リーフレットパッケージ、HTMLタグの文字ベクトルをポップアップに渡す?
例:
コンテンツ
[1] "<b><a href='http://www.samurainoodle.com'>Samurai Noodle</a></b><br/>606 5th Ave. S<br/>Seattle, WA 98138"
鉱山:
鳥$ htmlの[1]
[1] "<a href=‘https://www.allaboutbirds.org/guide/Gadwall/id’>more info</a>"
しかし、リーフレットのポップアップにコードを渡すと、より多くの情報ハイパーリンクが表示され、URLではなく見つからないページにリンクします。 HTMLタグにスラッシュや引用などの特殊文字を追加する必要がありますか?何かご意見は?
leaflet() %>%
addTiles(urlTemplate = base_map, attribution = mb_attribution)%>%
addMarkers(bird$lon, bird$lat,
popup=paste(sep="","<b>", bird$Common.Name,"</b>",
"<br/>","<font size=2 color=#045FB4>","Scientific Name: ","</font>" ,bird$Scientific.Name,
"<br/>","<font size=2 color=#045FB4>","Number Observed: ","</font>", bird$Count,
"<br/>","<font size=2 color=#045FB4>","Location: ","</font>", bird$Location,
"<br/>","<font size=2 color=#045FB4>","Region: ","</font>", bird$Area,
"<br/>","<font size=2 color=#045FB4>", "Date: ", "</font>", bird$Date,
"<br/>", bird$html),
clusterOptions = markerClusterOptions()) %>%
addPopups(bird$lon, bird$lat, bird$html, options = popupOptions(closeButton = FALSE)
)
またもっと精巧なポップアップについては、[この回答](http://stackoverflow.com/questions/29173336/how-to-display-advanced-customed-popups-for-leaflet-in-shiny)をご覧ください。 –