IP 데이터에서 국가 별 R로 위치 데이터 구하기
Country level geolocation data using R based on IP addresses
여러분이 IP 주소를 가지고 있다고 하자. Now let's assume you have an IP address. 예를 들어 125.209.222.141. For example, the address is 125.209.222.141, which is Naver.com. 이 주소는 Naver.com의 IP주소이다. 어느 나라의 IP인지 확인해보자. Let's find out the geolocation of this site especially which country it is!
우선 우리는 rgeolocate 패키지를 필요로 한다. First, we need {rgeolocate}, R pakcage. 설치하고 다음과 같이 따라해보자. Install it by yourself, and let's do the following:
> library(rgeolocate)
> geofile=system.file("extdata","GeoLite2-Country.mmdb",package="rgeolocate")
> maxmind("125.209.222.141",geofile)
결과는 The result is,
continent_name country_name country_code
1 Asia Republic of Korea KR
여러분이 IP 주소를 가지고 있다고 하자. Now let's assume you have an IP address. 예를 들어 125.209.222.141. For example, the address is 125.209.222.141, which is Naver.com. 이 주소는 Naver.com의 IP주소이다. 어느 나라의 IP인지 확인해보자. Let's find out the geolocation of this site especially which country it is!
우선 우리는 rgeolocate 패키지를 필요로 한다. First, we need {rgeolocate}, R pakcage. 설치하고 다음과 같이 따라해보자. Install it by yourself, and let's do the following:
> library(rgeolocate)
> geofile=system.file("extdata","GeoLite2-Country.mmdb",package="rgeolocate")
> maxmind("125.209.222.141",geofile)
결과는 The result is,
continent_name country_name country_code
1 Asia Republic of Korea KR
댓글
댓글 쓰기