R - Leaflet Code "Error in mutate_impl(.data, dots) : object 'address.lon' not found" -


i'm trying re-appropriate leaflet code used 6 months ago, had no problem @ time. haven't used leaflet since , no longer able generate maps before.

simply put, after switching out variables in same way have many other maps 6 months ago, receiving following error message , not sure how fix it: error in mutate_impl(.data, dots) : object 'address.lon' not found

i loaded appropriate packages , data formats. basic troubleshooting has been addressed. how fix this?

the contextual code following:

example data org dept address latitude longitude abc, inc., spsg, 111111 north whatever houston, tx 77058, 29.5431888, -95.1023828 def, inc., security systems, 111 north sepulveda boulevard 2000 el segundo, ca 90245, 42.6379953, -71.2459721   df %>%   mutate(popup_info=paste(sep = "<br/>", paste0("<b>","<i>", org,"<i>", "</b>"), dept)) %>%  filter(!is.na(longitude) & !grepl("closed", org)) %>%  filter(!is.na(latitude) & !grepl("closed", org)) -> df1  ## plot maps # client map orgpal <- colorfactor(plasma(7), df1$org)  leaflet(df1) %>% addprovidertiles("cartodb.positron") %>% addcirclemarkers(lng = ~longitude,                 lat = ~latitude,                 radius = 2.5,                 fillcolor = ~orgpal(orgpal),                stroke=false,                fillopacity = 1,                popup = ~popup_info) %>% addlegend("bottomright", pal = orgpal, values = ~org, labels = "organization", title = "client locations") %>% addminimap(tiles = providers$cartodb.positronnolabels, width = 120, height=80) 

am misunderstanding function of address.lon? apologize if lack of understanding of coding prevents me seeing easy fix, haven't interacted code in while. appreciate can receive.

your script failing because address.lon in ifelse statement refers nothing in obvious local environment based on code included.

it not in "sp" package, or "rgdal" or "leaflet" , have not defined function , cannot see have loaded access prior calling it.

it also, not column in data frame. so, r has pull when reaches in code.

it guess prior leaflet project had more preceding code , address.lon defined in it.

if post of code in edit, or link in file somewhere out in wilds of web, 1 of figure out both address.lon does, , how working in mapping script.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -