The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Importing APSIM Classic and NewGeneration files

Rai Schwalbert & Adrian Correndo

2023-04-13

1. Introduction


The metrica package was developed to assess the prediction performance of, among other, crop simulation models such as APSIM.

This vignette introduces the functionality of the metrica package applied to facilitate opening APSIM output files in R.

Import data from APSIM


1. APSIM Classic (.out)

# Obtaining filepath from package folder
apsim_out_filepath <- system.file("extdata/soybean.out", package = "metrica")

# Use import_apsim_out for APSIM Classic output
soybean.out <- metrica::import_apsim_out(filepath = apsim_out_filepath)

head(soybean.out)

2. APSIM NextGeneration (.db)

# Obtaining path from package folder
apsim_db_folderpath <- system.file("extdata", package = "metrica")

# Use import_apsim_db for APSIM NextGeneration output
soybean.db <- metrica::import_apsim_db(filename = "soybean.example.db", folder = apsim_db_folderpath)

head(soybean.db)

# If observed.data is already as a dataframe, the user may do the match using a simple code like this:
# PO.dataframe <- simulated.data %>% left_join(., observed.data) *by = "col" arg. could be required*

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.