Install and Get Started

Minimal install notes and first-run routes for np, npRmpi, and crs.
Keywords

install np, install npRmpi, install crs, quickstart, RStudio, MPI

This page is intentionally short. The goal is to get you from installation to a first successful run without making you read a general introduction to R first.

Step 1: install R and an editor

You will need a working installation of R and, if you prefer an IDE, RStudio / Posit Desktop.

Step 2: install the package you want

For np and crs, installation from CRAN is straightforward.

install.packages("np")
install.packages("crs")

For npRmpi, installation depends on the MPI implementation available on your system. The current platform and mode guidance lives on MPI and Large Data.

Step 2a: if you need npRmpi, choose the right first run

  • On macOS and Linux, start with the session / spawn quickstart unless you already know you need mpiexec.
  • On Windows, start with attach mode under mpiexec; the current package source explicitly treats that as the supported entry path rather than spawn.
  • If you need explicit broadcast control or a heterogeneous-cluster workflow, use the profile route on MPI and Large Data.

Step 2b: use the smallest runnable script first

The quickest way to see working code is now Quickstarts. That page shows the small starter scripts inline so you can copy them directly without downloading anything first.

Step 3: test that the package loads

These are simple first checks.

library(np)
example(npreg)
library(crs)
example(crs)

A small first run in np

If you want a very small end-to-end example, this is a good place to begin.

library(np)
data(cps71, package = "np")

fit <- npreg(logwage ~ age, data = cps71)
plot(cps71$age, cps71$logwage, cex = 0.25, col = "grey")
lines(cps71$age, fitted(fit), col = 2, lwd = 2)

What next?

Back to top