Learn R Programming

rIP (version 0.1.1)

getIPinfo: Passes an array of IP addresses to iphub.info and returns a dataframe with details of IP

Description

Makes a call to an IP address verification service (iphub.info) that returns the information on the IP address, including the internet service provider (ISP) and whether it is likely a server farm being used to disguise a respondent's location.

Usage

getIPinfo(d, "i", "key")

Arguments

d

Data frame where IP addresses are stored

i

Name of the vector in data frame, d, corresponding to IP addresses in quotation marks

key

User's X-key in quotation marks

Value

ipDF A dataframe with the IP address, country code, country name, asn, isp, block, and hostname.

Details

Takes an array of IPs and the user's X-Key, and passes these to iphub.info. Returns a dataframe with the IP address (used for merging), country code, country name, asn, isp, block, and hostname.

Examples

Run this code
# NOT RUN {
id <- c(1,2,3,4) # fake respondent id's
ips <- c(123.232, 213.435, 234.764, 543.765) # fake ips
data <- data.frame(id,ips)
getIPinfo(data, "ips", "MzI3NDpJcVJKSTdIdXpQSUJLQVhZY1RvRxaXFsFW3jS3xcQ")
# }

Run the code above in your browser using DataLab