How to convert a column of IP addresses (e.g., 000.000.000) into city names in R?

60 Views Asked by At

I have been trying to convert this column into city names. I followed some potential solutions I found online, however, some of the packages (e.g., "rgeolocate") they used were not downloadable anymore.

Anyone has any suggestions? You will really be my life saver!

This is packages I found but didn't work out:

`##ip 
install.packages("iptools")
install.packages("rgeolocate")#not available 
install.packages("ggalt")
ilter(world_map, region != "Antarctica")`
1

There are 1 best solutions below

0
ooi18 On

Have you try to use IP2Location R package(https://github.com/ip2location/ip2location-r)?

something like:

ip2location::open('IP2Location_BIN_Database')
ip2location::get_all("8.8.8.8")