R/functions.R

Defines functions my_ip

Documented in my_ip

#' My IP
#'
#' Obtain IP address according to ipconfig
#'
#' @return Character vector with IP address
#' @export
#' @examples
#'#' my_ip()

my_ip <- function(){
  ip <- system(command = "ipconfig", intern = T)
  ip <- ip[grep("IPv4", ip)]
  first <- regexpr("IPv4", ip)
  ip <- substr(ip, first+4, nchar(ip) )
  second <- regexpr(":", ip)
  ip <- substr(ip, second + 2, nchar(ip))
  return(ip)
}
jean9208/Personal_Package documentation built on May 25, 2019, 6:23 p.m.