read_apsim: Read Multiple APSIM Output Files

Description Usage Arguments Value Source Examples

View source: R/read_apsim.R

Description

This function is optimized for reading multiple APSIM output files and storing the data in a single data frame.

If 'file' is missing, the folder indicated in 'path' will be scanned by list.files and all contained files will be loaded. If some tables contains less columns, missing columns will be created and filled with the value indicated in 'empty_cols' (usually '0' or 'NA'). The entry indicated as title (usually the name of the file without extension) is inserted as column 'index' for the respective simulations.

Usage

1
read_apsim(file, path = ".", pattern = "out", na_strings, empty_cols = 0)

Arguments

file

Character vector with the names to be read.

path

A character value indicating the relative or absolute path to the folder containing the files.

pattern

A character value indicating the extension of the files (passed to list.files).

na_strings

Character vector with values that have to be converted into NAs.

empty_cols

Value used to fill new columns, if required.

Value

A data frame with daily records as rows and all variables as columns.

Source

Visit the site of the APSIM Initiative (http://www.apsim.info).

Examples

1
2
3
## APSIM example installed in package
rice <- read_apsim(path=path.package("cropgrowth"))
head(rice)

kamapu/cropgrowth documentation built on Aug. 22, 2021, 8:55 a.m.