Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9181337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:17:21+00:00 2026-06-17T18:17:21+00:00

Does anyone know of an R function that is able to retrieve one’s own

  • 0

Does anyone know of an R function that is able to retrieve one’s own IP address (of the PC you’re working on)? It would be very helpful! Many thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:17:23+00:00Added an answer on June 17, 2026 at 6:17 pm

    You can issue a system() command to your operating system:

    • In Windows you can use ipconfig
    • In Linux, use ifconfig

    For example, on Windows try calling system() with the argument intern=TRUE to return the results to R:

    x <- system("ipconfig", intern=TRUE)
    

    This returns:

    x
     [1] ""                                                                   
     [2] "Windows IP Configuration"                                           
     [3] ""                                                                   
     [4] ""                                                                   
     [5] "Wireless LAN adapter Wireless Network Connection:"                  
     [6] ""                                                                   
     [7] "   Connection-specific DNS Suffix  . : tbglondon.local"             
     [8] "   Link-local IPv6 Address . . . . . : fe80::c0cb:e470:91c7:abb9%14"
     [9] "   IPv4 Address. . . . . . . . . . . : 10.201.120.184"              
    [10] "   Subnet Mask . . . . . . . . . . . : 255.255.255.0"               
    [11] "   Default Gateway . . . . . . . . . : 10.201.120.253"              
    [12] ""                                                                   
    [13] "Ethernet adapter Local Area Connection:"                            
    [14] ""                                                                   
    [15] "   Connection-specific DNS Suffix  . : tbglondon.local"             
    [16] "   Link-local IPv6 Address . . . . . : fe80::9d9b:c44c:fd4d:1c77%11"
    [17] "   IPv4 Address. . . . . . . . . . . : 10.201.120.157"              
    [18] "   Subnet Mask . . . . . . . . . . . : 255.255.255.0"               
    [19] "   Default Gateway . . . . . . . . . : 10.201.120.253"              
    [20] ""                                                                   
    [21] "Tunnel adapter Local Area Connection* 13:"                          
    [22] ""                                                                   
    [23] "   Media State . . . . . . . . . . . : Media disconnected"          
    [24] "   Connection-specific DNS Suffix  . : "                            
    [25] ""                                                                   
    [26] "Tunnel adapter isatap.tbglondon.local:"                             
    [27] ""                                                                   
    [28] "   Media State . . . . . . . . . . . : Media disconnected"          
    [29] "   Connection-specific DNS Suffix  . : tbglondon.local"             
    [30] ""                                                                   
    [31] "Tunnel adapter Teredo Tunneling Pseudo-Interface:"                  
    [32] ""                                                                   
    [33] "   Media State . . . . . . . . . . . : Media disconnected"          
    [34] "   Connection-specific DNS Suffix  . : "                            
    

    Now you can use grep to find the lines with IPv4:

    x[grep("IPv4", x)]
    [1] "   IPv4 Address. . . . . . . . . . . : 10.201.120.184"
    [2] "   IPv4 Address. . . . . . . . . . . : 10.201.120.157"
    

    And to extract just the ip address:

    z <- x[grep("IPv4", x)]
    gsub(".*? ([[:digit:]])", "\\1", z)
    "10.201.120.184" "10.201.120.157"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know of an available PHP function that takes a piece of text,
Does anyone know a good tool that would give me x86 instruction execution count.
Does anyone know if SwiftMailer send function returns delivery status? I would like to
Does anyone know of a function that can create an lm object given a
Does anyone know of a Java library that would assist in creating a GUI
Does anyone know a WPF control/app that functions like the google Finance graph/chart? Thank
Does anyone know of a macro function in OpenOffice like exec() or system() in
Does anyone know if there is a builtin function for reading from the console
Does anyone know how to watch a variable in calling function. For example: C#:
Does anyone know how I can reverse this function to produce the original input

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.