Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Higher Precision from GGMAP

Tags:

r

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.

like image 510
sean Avatar asked Feb 11 '26 10:02

sean


1 Answers

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"
like image 191
cory Avatar answered Feb 14 '26 04:02

cory