PWC_fg: Weather file for Pesticide in Water Calculator (PWC) and...

Description Usage Arguments Value Examples

View source: R/PWC_fg.R

Description

The function PWC_fg converts a weather dataset to the file needed as input for PWC and PRZM5. Units should be converted previously. The format is described in detail in the PRZM5 manual.

Usage

1
2
PWC_fg(data, date, start, end, format_date, temp_celsius, precip_cm,
  ws10_cm_s, pevp_cm, solr_lang, save_in)

Arguments

data

Name of the dataset.

date

Column name for dates

start

Date to start the weather file

end

Date to end the weather file

format_date

Date format (more details in strptime documentation)

temp_celsius

Column name for temperature (Celsius)

precip_cm

Column name for precipitation (cm/day)

ws10_cm_s

Column name for wind speed values (cm/sec)

pevp_cm

Column name for panevaporation data (cm/day)

solr_lang

Column name for solar radiation (Langley)

save_in

Path to save the final weather file. Extension .dvf do not need to be specified.

Value

To create a weather file in a format readable by PWC and PRZM5 models

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Example of a small dataset.
data <- data.frame(date = c("01/01/81", "02/01/81", "03/01/81", "04/01/81"),
                   precip = c(0.00, 0.10, 0.00, 0.00),
                   evap = c(0.30, 0.21, 0.28, 0.28),
                   tmed = c(9.5, 6.3, 3.5, 5),
                   wind = c(501.6, 368.0, 488.3, 404.5),
                   solrad = c(240.3, 244.3, 303.0, 288.5))

# Load the package
library(PWCfilegenerator)

# Function to convert and save the weather file as a .dvf
PWCfilegenerator::PWC_fg(data = data,
                        date = "date",
                        format = "%d/%m/%y",
                        start ="02/01/81",
                        end = "03/01/81",
                        precip_cm = "precip",
                        pevp_cm = "evap",
                        temp_celsius = "tmed",
                        ws10_cm_s = "wind",
                        solr_lang = "solrad",
                        save_in = "F:/folder/filename") # The extension .dvf will be added automatically.

flor14/PWC_filegenerator documentation built on Dec. 6, 2020, 4:05 a.m.