R/system_ip_address.R

Defines functions system_ip_address

Documented in system_ip_address

#' Function to return system's IP address. 
#' 
#' @author Stuart K. Grange
#' 
#' @return Character vector. 
#' 
#' @export
system_ip_address <- function() {
  
  text <- system("hostname -I", intern = TRUE)
  x <- stringr::str_split_fixed(text, " ", 2)[1]
  return(x)
  
}
skgrange/systemr documentation built on April 18, 2024, 2:23 a.m.