-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathfreegeoip.Rd
More file actions
58 lines (53 loc) · 1.44 KB
/
Copy pathfreegeoip.Rd
File metadata and controls
58 lines (53 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
% Generated by roxygen2 (4.0.0): do not edit by hand
\name{freegeoip}
\alias{freegeoip}
\title{Geolocate IP addresses in R}
\source{
\url{http://heuristically.wordpress.com/2013/05/20/geolocate-ip-addresses-in-r/}.
\url{http://freegeoip.net/json/}
}
\usage{
freegeoip(ip = myip(), format = ifelse(length(ip) == 1, "list",
"dataframe"), ...)
}
\arguments{
\item{ip}{a character vector of ips (default is the
output from \link{myip})}
\item{format}{format of the output. Either "list"
(default) or "data.frame"}
\item{...}{not in use}
}
\value{
a list or data.frame with details on your geo location
based on the freegeoip.net service.
}
\description{
This R function uses the free freegeoip.net geocoding
service to resolve an IP address (or a vector of them) into
country, region, city, zip, latitude, longitude, area and
metro codes.
The function require rjson.
}
\examples{
\dontrun{
freegeoip()
## http://www.students.ncl.ac.uk/keith.newman/r/maps-in-r
# install.packages("maps")
# install.packages("mapdata")
library(maps)
library(mapdata) # Contains the hi-resolution points that mark out the countries.
map('worldHires')
require(installr)
myip_details <- freegeoip(myip())
my_lati <- myip_details$latitude
my_long <- myip_details$longitude
points(my_lati,my_long,col=2,pch=18, cex = 1)
# lines(c(my_lati,0) ,c(my_long, 50), col = 2)#'
}
}
\author{
Heuristic Andrew (see source for details)
}
\seealso{
\link{freegeoip}, \link{myip}, \link{cranometer}
}