MyNixOS website logo
Description

'Circuitscape' and 'Omniscape' Connectivity Analysis via 'Julia'.

Provides an R-native interface to the 'Circuitscape.jl' and 'Omniscape.jl' 'Julia' packages for landscape connectivity modeling using circuit theory. Users work entirely in R with familiar objects (SpatRaster, file paths) while 'Julia' handles computation invisibly. Supports all four 'Circuitscape' modes (pairwise, one-to-all, all-to-one, advanced) and 'Omniscape' moving-window analysis. Methods are described in McRae (2006) <doi:10.1111/j.0014-3820.2006.tb00500.x> and Landau et al. (2021) <doi:10.21105/joss.02829>.

circuitscaper circuitscaper website

R-CMD-check

circuitscaper provides a streamlined R interface for Circuitscape.jl and Omniscape.jl. It allows you to run these high-performance landscape connectivity models entirely from R, while Julia handles the heavy lifting under the hood.

  • Native R Workflow: Input and output terra raster objects directly.
  • Automated Setup: One-line installation of Julia and all required dependencies.
  • High Performance: Leverages Julia’s state-of-the-art solvers for large landscapes.

Note: circuitscaper is an independent R package and is not affiliated with the Circuitscape development team. It is a lightweight wrapper to the excellent Julia tools developed by Brad McRae, Viral Shah, Tanmay Mohapatra, Ranjan Anantharaman, and collaborators.

Installation

# 1. Install the R package
remotes::install_github("matthewkling/circuitscaper")

# 2. Let the package install Julia and the necessary Julia libraries
library(circuitscaper)
cs_install_julia()

Example

library(circuitscaper)
library(terra)

# Load an example resistance raster
resistance <- rast(system.file("extdata/resistance.tif", package = "circuitscaper"))

# Pairwise Circuitscape
# (result is a list containing the pairwise resistance matrix and current maps)
focal_sites <- matrix(c(10, 40, 40, 40, 25, 10), ncol = 2, byrow = TRUE)
result <- cs_pairwise(resistance, focal_sites)
plot(result$current_map)

# Omniscape -- wall-to-wall moving-window connectivity
# (result is a multi-layer raster of current flow variables)
result <- os_run(resistance, radius = 10)
plot(result$normalized_current)

Functions

FunctionDescriptionJulia backend
cs_pairwise()Pairwise effective resistance and current flowCircuitscape.compute()
cs_one_to_all()One-to-all connectivity analysisCircuitscape.compute()
cs_all_to_one()All-to-one connectivity analysisCircuitscape.compute()
cs_advanced()Advanced mode with custom sources and groundsCircuitscape.compute()
os_run()Omniscape moving-window connectivityOmniscape.run_omniscape()
cs_setup()Initialize Julia session (called automatically)JuliaCall::julia_library()
cs_install_julia()Install Julia and required packagesJuliaCall::install_julia(), JuliaCall::julia_install_package()

Requirements

  • R >= 4.0
  • Julia >= 1.9 (installed automatically via cs_install_julia())
  • R packages: terra, JuliaCall

Learn More

  • Getting started vignette
  • Circuitscape user guide
  • Omniscape documentation
  • McRae, B.H. (2006). Isolation by resistance. Evolution, 60(8), 1551-1561.
  • McRae, B.H. & Beier, P. (2007). Circuit theory predicts gene flow in plant and animal populations. PNAS, 104(50), 19885-19890.
  • McRae, B.H., Dickson, B.G., Keitt, T.H. & Shah, V.B. (2008). Using circuit theory to model connectivity in ecology, evolution, and conservation. Ecology, 89(10), 2712-2724.
Metadata

Version

0.1.0

License

Unknown

Platforms (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows