Learn R Programming

The ResistorArray package: electrical properties of resistor arrays


Overview

The ResistorArray package gives functionality for calculating electrical properties of resistor networks. Any array of resistors may be implemented and a number of special arrays are given as data. For example, a skeleton cube has 8 nodes and a conductance matrix for unit resistors along each edge is given by cube():

cube()
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
## [1,]    3   -1    0   -1   -1    0    0    0
## [2,]   -1    3   -1    0    0   -1    0    0
## [3,]    0   -1    3   -1    0    0   -1    0
## [4,]   -1    0   -1    3    0    0    0   -1
## [5,]   -1    0    0    0    3   -1    0   -1
## [6,]    0   -1    0    0   -1    3   -1    0
## [7,]    0    0   -1    0    0   -1    3   -1
## [8,]    0    0    0   -1   -1    0   -1    3

A common puzzle is to calculate the resistance of such a cube between diagonally opposite corners, the answer being (the trick being to observe that nodes equidistant from the corners are at the same potential). This is easily reproduced in the package:

resistance(cube(),1,7)
## [1] 0.8333333

However, the trick does not work for general resistances but the package has no problem:

resistance(cube(1:12),1,7)
## [1] 4.766791

The package includes many other convenience functions; it is still under development.

Installation

To install the most recent stable version on CRAN, use install.packages() at the R prompt:

R> install.packages("ResistorArray")

To install the current development version use devtools:

R> devtools::install_github("RobinHankin/ResistorArray")

And then to load the package use library():

library("ResistorArray")

Reference

R. K. S. Hankin 2006. “Resistor networks in R: introducing the ResistorArray package”. R News, 6(2),52-54

Copy Link

Version

Install

install.packages('ResistorArray')

Monthly Downloads

232

Version

1.0-33

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Robin K S Hankin

Last Published

July 21st, 2026

Functions in ResistorArray (1.0-33)

ladder

Jacob's ladder of resistors
platonic

Adjacency of platonic solids
makefullmatrix

Conductance matrix for a lattice of unit resistors
currents

Calculates currents in an arbitrary resistor array
cube

Specimen conductance matrices
series

Conductance matrix for resistors in series
circuit

Mensurates a circuit given potentials of some nodes and current flow into the others
SquaredSquare

A Squared square
array.resistance

Resistance between two arbitrary points on a regular lattice of unit resistors
ResistorArray-package

tools:::Rd_package_title("ResistorArray")
hypercube

Conductance matrix of a Boolean hypercube
Wu

Wu's resistance matrix
resistance

Resistance for arbitrarily connected networks of resistors