Skip to contents

This function takes a Raster object and identifies non NA cells and writes them to a .dat file as a Must Include. The file will be written to the location specified by the name argument. If the file already exists, it will be overwritten. The file format is plain text, with each line terminated by a newline character.

Usage

Locked_in_Cells(Lockedin, name = "Problem")

Arguments

Lockedin

A Raster object with a value of one in the cells that are locked in as solutions to the problem and NA values elsewhere

name

The name of the output file

Value

.dat file. This function is used for the side-effect of writing values to a file.

Author

Derek Corcoran

Examples

data(Species)
library(terra)
#> terra 1.8.10
Test <- Species[[1]] |>
terra::unwrap()

# Generate the "Problem.dat" file

define_cells(Test[[1]])
#>           used (Mb) gc trigger  (Mb) max used  (Mb)
#> Ncells 1713206 91.5    3221740 172.1  3124124 166.9
#> Vcells 2579475 19.7    8388608  64.0  3627271  27.7

file.remove("Problem.dat")
#> [1] TRUE