Learn R Programming

bossMaps (version 0.1.0)

compress: Compress maxent output by converting from ASCII file to compressed geotif

Description

Maxent writes out ASCII files that are uncompressed. This function transforms the data, converts it to a compressed geotif, and deletes the original. The default transform rtrans is to take the $round(log(x)*100)$. Note that this conversion may be lossy depending on the transform applied.

Usage

compress(file, fun = rtrans)
rtrans(x)
unrtrans(x)

Arguments

file
character path to file to be compressed
fun
Function to use to compress the data. Default is rtrans(), which is round(log(x)*100.
x
value passed to rtrans or untrans for conversion.
...
additional functions to be passed to writeRaster()

Value

Returns the converted file as a raster() object

Functions

  • rtrans: transform data to faciliate storing as an integer as $round(log(x)*100)$.
  • unrtrans: uncompress data transformed with rtrans