get_iem_apsim_met: Get weather data from Iowa Environmental Ag Weather Stations

View source: R/get_iemre_apsim_met.R

get_iem_apsim_metR Documentation

Get weather data from Iowa Environmental Ag Weather Stations

Description

Retrieves weather data from Iowa Environmental Mesonet (AgWeather) into an APSIM met file

Usage

get_iem_apsim_met(lonlat, dates, wrt.dir = ".", state, station, filename)

Arguments

lonlat

Longitude and latitude vector (optional)

dates

date ranges

wrt.dir

write directory

state

state which you choose climate data from

station

station which you choose cliamte data from

filename

file name for writing out to disk

Details

The original data can be obtained from: https://mesonet.agron.iastate.edu/request/coop/fe.phtml

If the filename is not provided it will not write the file to disk, but it will return an object of class ‘met’. This is useful in case manipulation is required before writing to disk. For this function either provide the longitude and latitude or the state and station, but not both. In fact, ‘state’ and ‘station’ will be ignored if ‘lonlat’ is supplied.

Value

returns an object of class ‘met’ and writes a file to disk when filename is supplied.

Examples

## Not run: 
## This will not write a file to disk
iem.met <- get_iem_apsim_met(state = "IA", 
                             station = "IA0200", 
                             dates = c("2012-01-01","2012-12-31"))

summary(iem.met)

## Alternatively, coordinates can be used
## This should be equivalent to the previous request
iem.met2 <- get_iem_apsim_met(lonlat = c(-93.77, 42.02), 
                              dates = c("2012-01-01","2012-12-31"))

summary(iem.met2)

## End(Not run)


apsimx documentation built on March 18, 2022, 7:52 p.m.