View source: R/zeroMissingPrecip.R
zeroMissingPrecip | R Documentation |
Removes missing precipitation (NA_real_
values (p and/or ppt) in an obs dataframe, by setting them to zero. This function is potentially dangerous, as setting the missing values to zero prevents any further imputation/interpolation of values.
zeroMissingPrecip(obs, precipCols = 0, quiet = TRUE, logfile = "")
obs |
Required. A CRHMr obs dataframe. |
precipCols |
Optional. A vector containing the numbers of the columns (excluding the datetime) to be processed. If omitted, all of the columns whose names contain p or ppt will be processed |
quiet |
Optional. Suppresses display of messages, except for errors. If you are calling this function in an R script, you will usually leave |
logfile |
Optional. Name of the file to be used for logging the action. Normally not used. |
If the action is successful, returns a dataframe with all missing precipitation values set to zero. If the action is unsuccessful, then the value FALSE
is returned. If quiet=FALSE
, then a summary of the returned obs data will be returned.
As described, this function is potentially dangerous, and its action CANNOT be undone. It should only be used when there is no further hope for imputing/interpolating precipitation data. Note that its use is really only justified in arid or semi-arid climates, where precipitation is rare. Because it is so destructive, the function should only be used immediately before exporting to an obs file.
Kevin Shook
writeObsFile
BadLake7376.clean <- zeroMissingPrecip(BadLake7376, quiet=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.