Skip to content

Instantly share code, notes, and snippets.

@sjewo
Created December 11, 2012 14:53
Show Gist options
  • Save sjewo/4259099 to your computer and use it in GitHub Desktop.
Save sjewo/4259099 to your computer and use it in GitHub Desktop.
ping function for R (linux)
ping <- function(x,stderr=FALSE,stdout=FALSE,...){
ping <- system(paste("ping -c1", x, "> /dev/null"),
intern=F,
ignore.stdout=stdout,
ignore.stderr=stderr)
return(if (ping == 0) TRUE else FALSE)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment