Check if a Remote Computer is Up

Check if a remote computer is up. It can either just call the system ping command, or check a specified TCP port.

Linux Build Status Windows Build status CRAN RStudio mirror downloads

The pingr package is a simple utility that can be used to check if a remote machine is running, by sending network packets to it. It is similar to the command line ping program, in fact for ICMP packages it just calls ping.

ICMP ping

The ping() function does ICMP ping, via the system's ping utility:

#> [1] 0.055 0.061 0.123

By default it sends three packets and measures the time it receives and answer. It waits between sending out the packets, so if you want a really quick check, you can just send a single packet:

ping("", count = 1)
#> [1] 0.046

If a machine is down (or it does not exist), then NA is returned instead of the roundtrip time:

ping("", count = 1)
#> [1] NA

TCP ping

With TCP ping we can check if a machine is listeing on a TCP port, e.g. if google's search web server is up and running:

ping_port("", port = 80, count = 1)
#> [1] 78.884


Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


2.0.1 by Gábor Csárdi, a year ago

Report a bug at

Browse source code at

Authors: Gábor Csárdi [aut, cre]

Documentation:   PDF Manual  

MIT + file LICENSE license

Imports processx, utils

Suggests covr, testthat

Imported by cymruservices, hydroscoper, proffer, ropenblas, shinytest, waterquality.

Suggested by devtools, epwshiftr, pak, pkgcache, pkgdepends, pkgsearch, ps, remotes, targets, wdpar, webdriver.

See at CRAN