This function takes a Raster object and identifies non NA cells and writes them to a .dat file. 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.
Examples
data(Species)
library(terra)
Test <- Species[[1]] |>
terra::unwrap()
# Generate the "Problem.dat" file
define_cells(Test[[1]])
#> used (Mb) gc trigger (Mb) max used (Mb)
#> Ncells 1755291 93.8 3301388 176.4 3301388 176.4
#> Vcells 2648671 20.3 8388608 64.0 5371240 41.0
file.remove("Problem.dat")
#> [1] TRUE