简体   繁体   中英

Get Higher Precision from GGMAP

I have the following code.

library(ggmap)
x = geocode("641123",output='all')
x$results[[1]]$geometry$location$lat

shows 55.62943.

If i query

http://maps.googleapis.com/maps/api/geocode/json?address=641123&sensor=false

The lat shown is 55.62942899999999.

I need higher precision, it there a way to get the missing decimal place ?

Thanks.

It's there, the printing is just clipping it. Use format among other things to see the entire value...

library(ggmap)
x = geocode("641123",output='all')
> format(x$results[[1]]$geometry$location$lat, digits=20)
[1] "55.629428999999988"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM