Skip to contents

Write metadata files in the cronus database.

Usage

write_metadata(x, ...)

# S4 method for Cropmaps
write_metadata(x, name, df_cat = NULL, tb_rcl = NULL)

# S4 method for Parameters
write_metadata(x, name, tb_ct = NULL)

Arguments

x

S4 object. A product of interest.

...

extra arguments.

name

character. The name of the metadata files.

df_cat

data.frame A data frame holding the cdl categories.

tb_rcl

matrix A matrix holding the cdl value recoding.

tb_ct

matrix. A matrix holding the cardinal temperatures.

Value

nothing. The data are saved directly in the cronus database.

Examples

if (FALSE) {
# Define required variables
region <- Region(name = "nebraska", type = "us state",
                 div = c(country = "United States", state = "Nebraska"))
date <- date_seq("2002-01-01", "2002-12-31")

## Parameters

# Create the object
x <- new("Parameters", region = region, date = date)

# Define the cardinal temperatures metadata
tb_ct <- rbind('Dry Beans' = c(Tb = 4.0,  To = 23.0, Tc = 32.0),
               'Corn'      = c(Tb = 10.0, To = 30.0, Tc = 50.0),
               'Soybeans'  = c(Tb = 6.0,  To = 26.0, Tc = 39.0))

# Write the metadata
write_metadata(y, name = "default", tb_ct = tb_ct)
}