将传单用于多个弹出窗口

时间:2019-07-16 10:55:35

标签: r shiny leaflet react-leaflet

遵循此code来创建多个弹出窗口值,以显示每个标记的年份,区域,flat_type和转售值,但它一直给我这个错误

  

错误:“ closure”类型的对象不可子集化

这是我从code开始所做的更改。 df是指数据集。传单图中有2个不同的数据集。

 output$mymap <- renderLeaflet({
    leaflet(data=df()) %>% 
        addTiles() %>% 
        addPolygons(data=adm, weight = 3, fillColor = "white", popup=popup)%>%
        addMarkers(clusterOptions = markerClusterOptions(), popup = paste("Year of Purchase:", df$year, "<br>",
                                                                          "Region", df$region, "<br>",
                                                                          "Flat-Type",df$flat_type,"<br>",
                                                                          "Resale Price:",df$resale_price , "<br>",
                                                                          "Address:", toupper(df$geoAddress)))%>%
        addMarkers(data=mrt,lat = ~lat,lng = ~lon,label=mrt$mrt_station,icon = mrticon)

这是我的数据

 head(headlinedata,1)
    month       town flat_type block      street_name storey_range floor_area_sqm flat_model lease_commence_date resale_price year month1
1 2007-01 ANG MO KIO    5 ROOM   259 ANG MO KIO AVE 2     04 TO 06            135    MODEL A                1982       345000 2007      1
      region                                  address      lat      lon                             geoAddress
1 North_East BLOCK 259 , ANG MO KIO AVE 2 , SINGAPORE 1.368554 103.8316 259 ang mo kio ave 2, singapore 560259

这是我的代码

0 个答案:

没有答案