Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

epi.asc

Write matrix to an ASCII raster file


Description

Writes a data frame to an ASCII raster file, suitable for display in a Geographic Information System.

Usage

epi.asc(dat, file, xllcorner, yllcorner, cellsize, na = -9999)

Arguments

dat

a matrix with data suitable for plotting using the image function.

file

character string specifying the name and path of the ASCII raster output file.

xllcorner

the easting coordinate corresponding to the lower left hand corner of the matrix.

yllcorner

the northing coordinate corresponding to the lower left hand corner of the matrix.

cellsize

number, defining the size of each matrix cell.

na

scalar, defines null values in the matrix. NAs are converted to this value.

Value

Writes an ASCII raster file (typically with *.asc extension), suitable for display in a Geographic Information System.

Note

The image function in R rotates tabular data counter clockwise by 90 degrees for display. A matrix of the form:

1 3
2 4

is displayed (using image) as:

3 4
1 2

It is recommended that the source data for this function is a matrix. Replacement of NAs in a data frame extends processing time for this function.


epiR

Tools for the Analysis of Epidemiological Data

v2.0.19
GPL (>= 2)
Authors
Mark Stevenson <mark.stevenson1@unimelb.edu.au> and Evan Sergeant <evansergeant@gmail.com> with contributions from Telmo Nunes, Cord Heuer, Jonathon Marshall, Javier Sanchez, Ron Thornton, Jeno Reiczigel, Jim Robison-Cox, Paola Sebastiani, Peter Solymos, Kazuki Yoshida, Geoff Jones, Sarah Pirikahu, Simon Firestone, Ryan Kyle, Johann Popp, Mathew Jay and Charles Reynard.
Initial release
2021-01-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.