Learn R Programming

meteoland (version 0.9.7)

readmeteorologypoint: Reads point meteorology from the disk

Description

Functions to read point meteorological data from the disks in different formats.

Usage

readmeteorologypoint(file, dates = NULL, format = "meteoland/txt", sep="\t")
readmeteorologypointfiles(points, files=NULL, dates = NULL, format="meteoland/txt", 
                          sep="\t")
readmeteorologypoints(files, dates = NULL, stations = NULL, format = "netCDF", 
                      varmapping = NULL, verbose = FALSE)

Arguments

file

A string of the file to be read.

points

An object of class SpatialPoints-class (in this case files cannot be NULL) or object of class SpatialPointsDataFrame-class with two data columns: 'dir' and 'filename' (and possibly 'format').

files

A vector of strings to be read (when points is of class SpatialPoints-class). Length and order must match points.

dates

Object of class "Date" describing a subset of dates to be extracted from meteorological series. If NULL the whole period read from files is kept.

format

Format of meteorological data. Current accepted formats for readmeteorologypoint and readmeteorologypointfiles are "meteoland/txt", "meteoland/rds", "castanea/txt" and "castanea/rds". The only accepted format for readmeteorologypoints is "netCDF".

sep

The field separator character for ascii text files (see read.table).

stations

An integer vector or string vector identifying point indices or station names in the netCDF.

varmapping

Named character vector specifying a mapping of variables in the NetCDF into variables used in meteoland (e.g. c(MinTemperature = "tmn") specifies a map of variable 'tmn' to MinTemperature).

verbose

A logical flag to output process information in the console.

Details

Function readmeteorologypoint reads data series of a single location from an ascii or rds file and returns a data frame. Function readmeteorologypointfiles can be used to read multiple ascii/rds files and build an object of SpatialPointsMeteorology-class. This is done by supplying an points object of class SpatialPointsDataFrame-class with point meta data. In readmeteorologypointfiles the value of format is used as default but can be overloaded if points includes a column 'format'.

Function readmeteorologypoints is used to read multiple point data from a netCDF. In this case, a mapping can be supplied to map variable names in the netCDF to variables used in meteoland.

See Also

writemeteorologypoint, read.table, SpatialPointsMeteorology-class