getip | R Documentation |
Get your internal/local or external/public IP address. Currently only IPv4 addresses are supported.
getip(type = "local")
type |
One of |
The internal/local IP lookup is done in-process, i.e., it does not call
system()
or the like.
For an external address, the function returns a lookup from one of several services, including Amazon AWS http://checkip.amazonaws.com/, httpbin http://httpbin.org/ip, ipify https://www.ipify.org/, and "My External IP address is ..." http://myexternalip.com/. You must be connected to the internet for this to work. Please note that pathological use could end up in your getting banned from these services, rendering the function useless. So don't call this function a billion times in a loop or something.
Returns the requested IP address as a string.
library(getip)
# internal/local address
getip("local") # same as getip("internal")
# external/public
getip("public") # same as getip("external")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.