Learn R Programming

hydroTSM (version 0.5-1)

zoo2RHtest: Zoo -> RHTest

Description

It creates the input file to the 'RHtest_dlyPrcp.r' script, used for testing the homogeneity of climatological time series (available at: http://etccdi.pacificclimate.org/software.shtml)

Usage

zoo2RHtest(x, fname="pcp.txt", tstep.out="daily", dec=".", na="-999.0")

Arguments

x

time series that will be written. class(x) must be a zoo object

fname

Character, with the filename of the precipitation time series

tstep.out

Character indicating the time step that have to be used for writing x into the output file

dec

the string to use for decimal points in numeric or complex columns: must be a single character.

na

character to be used for representing the missing values in the data

References

http://etccdi.pacificclimate.org/software.shtml http://etccdi.pacificclimate.org/RHtest/RHtestsV4_UserManual_10Dec2014.pdf http://css.escwa.org.lb/sdpd/1802/d2-1.pdf

Examples

Run this code
# NOT RUN {
## Loading the SanMartino precipitation data
data(SanMartinoPPts)
x <- SanMartinoPPts

#Getting the monthly ts
pcp.m <- daily2monthly(x, FUN=sum, na.rm=FALSE)

# From zoo to the input format required by 'FindU.dlyPrcp' function
zoo2RHtest(x=pcp.m, fname="pcp-monthly.txt", tstep.out="monthly", na="-999.0")

# }
# NOT RUN {
# Homogeneity analysis
FindU.dlyPrcp(InSeries="pcp-monthly.txt", output="pcp-monthly", MissingValueCode="-999.0", 
GUI=FALSE, pthr=0, Mq=10, p.lev=0.95, Iadj=10000)
# }

Run the code above in your browser using DataLab