Package 'precintcon'

Title: Precipitation Intensity, Concentration and Anomaly Analysis
Description: It contains functions to analyze the precipitation intensity, concentration and anomaly.
Authors: Lucas Venezian Povoa [aut, cre], Jonas Teixeira Nery [ctb]
Maintainer: Lucas Venezian Povoa <[email protected]>
License: GPL (>= 2)
Version: 2.3.0
Built: 2025-02-17 03:59:58 UTC
Source: https://github.com/lucasvenez/precintcon

Help Index


Amount and Percentage of Precipitation

Description

It calculates the amount and percentage of precipitation contributed by a such percent of rainiest days.

Usage

app(..., percent = 25)

Arguments

percent

is the percentage of the rainiest days to be considered (default = 25).

...

a set of daily precipitation series.

Value

data.frame containing the following variables:

  • dataset is the dataset name of the precipitation serie;

  • percentage is the percentage of the rainiest days;

  • absolute is the absolute amount of precipitation generated by percentage

  • relative is the percentage of precipitation benerated by percentage

Author(s)

Lucas Venezian Povoa [email protected]

See Also

read.data as.daily ci

Examples

##
# Loading the daily precipitation serie
data(daily) 

##
# Calculating amount and percentage of precipitation using different parameters

app(daily)

app(daily, percent = 20)

app(daily, percent = c(10, 15, 20, 25))

Converting to seasonal precipitation serie.

Description

Converts a daily, monthly, or seasonal precipitation serie to an annual serie.

Usage

as.annual(object)

Arguments

object

a precintcon.daily, precintcon.monthly, or precintcon.seasonal object or a data.frame containing 33 or 3 columns.

Value

A data.frame (precintcon.annual) containing the following variables:

  • year is the year.

  • precipitation is the precipitation amount in millimeters.

Author(s)

Lucas Venezian Povoa [email protected]

See Also

as.daily as.monthly as.seasonal pplot.lorenz read.data

Examples

##
# Loading the daily precipitation serie.
data(daily)

##
# Converting precipitation
as.annual(daily)

Converting a data.frame to a daily precipitation serie

Description

Converts a data.frame to a precintcon.daily.

Usage

as.daily(object, na.value = NA)

Arguments

object

a precintcon.daily or a data.frame containing 33 columns.

na.value

the value used for representing non-existent values (Default value: NA).

Value

A data.frame (precintcon.daily) containing the following variables:

  • year is the year.

  • month is the month.

  • d1 is the precipitation value in millimeters of the 1st day of the month.

  • d2 is the precipitation value in millimeters of the 2nd day of the month.

  • d3 is the precipitation value in millimeters of the 3rd day of the month.

  • d4 is the precipitation value in millimeters of the 4th day of the month.

  • d5 is the precipitation value in millimeters of the 5th day of the month.

  • d6 is the precipitation value in millimeters of the 6th day of the month.

  • d7 is the precipitation value in millimeters of the 7th day of the month.

  • d8 is the precipitation value in millimeters of the 8th day of the month.

  • d9 is the precipitation value in millimeters of the 9th day of the month.

  • d10 is the precipitation value in millimeters of the 10th day of the month.

  • d11 is the precipitation value in millimeters of the 11th day of the month.

  • d12 is the precipitation value in millimeters of the 12th day of the month.

  • d13 is the precipitation value in millimeters of the 13th day of the month.

  • d14 is the precipitation value in millimeters of the 14th day of the month.

  • d15 is the precipitation value in millimeters of the 15th day of the month.

  • d16 is the precipitation value in millimeters of the 16th day of the month.

  • d17 is the precipitation value in millimeters of the 17th day of the month.

  • d18 is the precipitation value in millimeters of the 18th day of the month.

  • d19 is the precipitation value in millimeters of the 19th day of the month.

  • d20 is the precipitation value in millimeters of the 20th day of the month.

  • d21 is the precipitation value in millimeters of the 21th day of the month.

  • d22 is the precipitation value in millimeters of the 22th day of the month.

  • d23 is the precipitation value in millimeters of the 23th day of the month.

  • d24 is the precipitation value in millimeters of the 24th day of the month.

  • d25 is the precipitation value in millimeters of the 25th day of the month.

  • d26 is the precipitation value in millimeters of the 26th day of the month

  • d27 is the precipitation value in millimeters of the 27th day of the month.

  • d28 is the precipitation value in millimeters of the 28th day of the month.

  • d29 is the precipitation value in millimeters of the 29th day of the month.

  • d30 is the precipitation value in millimeters of the 30th day of the month.

  • d31 is the precipitation value in millimeters of the 31th day of the month.

Author(s)

Lucas Venezian Povoa [email protected]

See Also

as.decade as.annual as.seasonal as.monthly

Examples

##
# Loading the daily precipitation serie.
data(daily)

##
# Converting precipitation
as.daily(daily)

Converting a precipitation serie to a decade serie

Description

It converts a daily, monthly or annual precipitation serie to a decade serie.

Usage

as.decade(object)

Arguments

object

a precintcon.daily, precintcon.monthly, precintcon.seasonal, precintcon.annual object or a data.frame containing 33 or 3 columns.

Details

It excludes no complete decades for converting the serie, e.g., a serie starting in 1977 and finishing in 2008 will have the year 1977 to 1979 and 2000 to 2008 excluded, resulting into a serie of the years 1980 and 1990.

Value

A data.frame (precintcon.decade) containing the following variables:

  • year is the year.

  • precipitation is the decade's precipitation in millimeters.

Author(s)

Lucas Venezian Povoa [email protected]

See Also

as.precintcon.annual as.precintcon.seasonal as.precintcon.monthly as.precintcon.daily

Examples

##
# Loading the daily precipitation serie.
data(daily)

##
# Converting precipitation
as.decade(daily)

Deciles of a precipitation serie

Description

Groups the monthly precipitation into decis, i.e., it splits a precipitation serie into ten equal parts in crescent order, from the lower to the highest precipitation.

Usage

as.precintcon.deciles(object)

Arguments

object

a daily or monthly precipitation serie.

Value

A data.frame (precintcon.deciles) containing the following variables:

  • D1 corresponds to the precipitation values not exceeding 10% of the lowest values.

  • D2 corresponds to the precipitation values not exceeding 20 of the lowest values.

  • D3 corresponds to the precipitation values not exceeding 30 of the lowest values.

  • D4 corresponds to the precipitation values not exceeding 40% of the lowest values.

  • D5 is equals to the median that corresponds to the precipitation values not exceeding 50% of the lowest values.

  • D6 corresponds to the precipitation values not exceeding 60% of the lowest values.

  • D7 corresponds to the precipitation values not exceeding 70 of the lowest values.

  • D8 corresponds to the precipitation values not exceeding 80 of the lowest values.

  • D9 corresponds to the precipitation values not exceeding 90 of the lowest values.

  • D10 corresponds to the precipitation values not exceeding 100 of the lowest values.

Author(s)

Lucas Venezian Povoa [email protected]

See Also

read.data


Frequency distribution of a precipitation serie

Description

Calculates the frequency distribution of a daily precipitation serie based on interval.

Usage

as.precintcon.fd(object, interval = 1)

Arguments

object

a daily precipitation serie.

interval

the interval in millimeters for calculating the frequency distribution.

Value

A data.frame (precintcon.fd) containing the following variables:

  • initial.class is the initial value of the class.

  • final.class is the final value of the class.

  • midpoint is the middle point of the class.

  • n is the absolute freqnecy, i.e., the number of days in each class.

  • sum.n is the cumulative frequency, obtained by adding the absolute frequencies of all the classes up to the one under consideration.

  • P is the pluviometric total of each class, obtained by multiplying midpoint by n.

  • sum.P is the cummulative class's pluviometric total, obtained by adding the pluviometric total of all the classes up to the one under consideration.

  • p.sum.n is the cumulative percentage of rainy days.

  • p.sum.P is the cumulative percentage of rainfall amounts.

Author(s)

Lucas Venezian Povoa [email protected]

See Also

read.data as.daily ci

Examples

##
# Loading the daily precipitation serie
data(daily)

##
# Performing the frequency distribution
as.precintcon.fd(daily)

Convert a daily precipitation serie to a monthly serie

Description

Converts a daily precipitation serie to a monthly serie.

Usage

as.monthly(object)

Arguments

object

a precintcon.daily object or a data.frame containing 33 or 3 columns

Value

A data.frame (precintcon.monthly) containing the following variables:

  • year is the year.

  • month is the month.

  • precipitation is the precipitation amount in millimeters.

Author(s)

Lucas Venezian Povoa [email protected]

See Also

pplot.lorenz read.data

Examples

## Loading the daily precipitation serie.
#
data(daily)

## Converting precipitation
#
as.monthly(daily)

Converting to seasonal precipitation serie

Description

It converts a daily or monthly precipitation serie to a seasonal serie according to meteorological seasons.

Usage

as.seasonal(object)

Arguments

object

a precintcon.daily, or precintcon.monthly object or a data.frame containing 33 or 3 columns.

Details

If the serie has no a month of a season, it is waived in convertion, e.g., if a serie has January and February of 1975, but no December of 1974, the first two months are removed of the resulting serie because the season that depends all of them is not complete.

Value

A data.frame (precintcon.seasonal) containing the following variables:

  • year is the year.

  • season is the season.

  • precipitation is the precipitation amount in millimeters.

Author(s)

Lucas Venezian Povoa [email protected]

See Also

pplot.lorenz read.data

Examples

##
# Loading the daily precipitation serie.
data(daily)

##
# Converting precipitation
as.seasonal(daily)

Concentration Index

Description

Calculates the Concentration Index (CI) on a daily precipitation serie.

Usage

ci(..., interval = 1)

Arguments

interval

the interval in millimeters applied for calculating the concentration index. (Default value: 1)

...

a set of daily precipitation series.

Value

A data.frame containing the following variables:

  • dataset is the precipitation serie name.

  • a is the constant of the exponential curve defined via the least-squares method.

  • b is the constant of the exponential curve defined via the least-squares method.

  • r2 is the determination of coefficient of determination (R2) of the exponential model.

  • A is the area over the exponential curve.

  • S is the are compressed for the exponential curve.

  • ci is the concentration index.

Author(s)

Lucas Venezian Povoa [email protected]

See Also

pplot.lorenz read.data as.daily

Examples

##
# Loading the daily precipitation serie.
data(daily)

##
# Performing the Concentration Index Analysis
ci(daily, interval = 1)

Concentration Index per Year

Description

Calculates the Concentration Index (CI) per year on a daily precipitation serie.

Usage

ci.per.year(object, interval = 1)

Arguments

object

a daily precipitation serie.

interval

the interval in millimeters applied for calculating the concentration index. (Default value: 1)

Value

A data.frame (precintcon.ci) containing the following variables:

  • year is the year.

  • ci is the concentration index.

Author(s)

Lucas Venezian Povoa [email protected]

See Also

pplot.lorenz read.data as.daily

Examples

##
# Loading the daily precipitation serie.
data(daily)

##
# Performing the Concentration Index Analysis
ci.per.year(daily, interval = 1)

Coefficient of Variance

Description

It calculates the coefficient of variance of a monthly precipitation.

Usage

cv(object)

Arguments

object

is a daily or monthly precipitation serie.

Details

A daily precipitation serie is transformed to a monthly serie.

Value

the coefficient of variance

Author(s)

Lucas Venezian Povoa [email protected]

Examples

##
# Loading the montly precipitation serie.
data(monthly)

##
# Calculating the Coefficient of Variance
cv(monthly)

Daily precipitation between 1976 and 2010

Description

This data set gives the daily precipitation (in millimeters) between 1976 and 2010, as compiled by the National Water Agency (ANA), Brazil.

Usage

data(daily)

Format

A data frame with 420 observations on the following 33 variables:

year

the year.

month

the month.

d1

the precipitation value in millimeters of the day #1 of the month.

d2

the precipitation value in millimeters of the day #2 of the month.

d3

the precipitation value in millimeters of the day #3 of the month.

d4

the precipitation value in millimeters of the day #4 of the month.

d5

the precipitation value in millimeters of the day #5 of the month.

d6

the precipitation value in millimeters of the day #6 of the month.

d7

the precipitation value in millimeters of the day #7 of the month.

d8

the precipitation value in millimeters of the day #8 of the month.

d9

the precipitation value in millimeters of the day #9 of the month.

d10

the precipitation value in millimeters of the day #10 of the month.

d11

the precipitation value in millimeters of the day #11 of the month.

d12

the precipitation value in millimeters of the day #12 of the month.

d13

the precipitation value in millimeters of the day #13 of the month.

d14

the precipitation value in millimeters of the day #14 of the month.

d15

the precipitation value in millimeters of the day #15 of the month.

d16

the precipitation value in millimeters of the day #16 of the month.

d17

the precipitation value in millimeters of the day #17 of the month.

d18

the precipitation value in millimeters of the day #18 of the month.

d19

the precipitation value in millimeters of the day #19 of the month.

d20

the precipitation value in millimeters of the day #20 of the month.

d21

the precipitation value in millimeters of the day #21 of the month.

d22

the precipitation value in millimeters of the day #22 of the month.

d23

the precipitation value in millimeters of the day #23 of the month.

d24

the precipitation value in millimeters of the day #24 of the month.

d25

the precipitation value in millimeters of the day #25 of the month.

d26

the precipitation value in millimeters of the day #26 of the month.

d27

the precipitation value in millimeters of the day #27 of the month.

d28

the precipitation value in millimeters of the day #28 of the month.

d29

the precipitation value in millimeters of the day #29 of the month.

d30

the precipitation value in millimeters of the day #30 of the month.

d31

the precipitation value in millimeters of the day #31 of the month.

Source

National Water Agency (ANA) http://www2.ana.gov.br/Paginas/default.aspx

Examples

data(daily)
## maybe pci(daily) ; rai(daily) ...

F factor

Description

It calculates the Approximated Rainfall Erosivity Factor according to the ff index.

Usage

ff.index(object)

Arguments

object

is a daily or monthly precipitation serie

Value

the ff index in millimeters

Author(s)

Lucas Venezian Povoa

References

Ferro, V., Giordano, G., Iovino, M. (1991). Isoerosivity and Erosion Risk Map for Sicily. Hydrolog. Sci. J. 36, 549-564

Examples

##
# Loading the daily precipitation serie.
data(daily)

##
# Calculating ff index
ff.index(daily)

Limits

Description

Calculates the upper and lower limit on a set of daily or monthly precipitation series.

Usage

limits(...)

Arguments

...

a set of daily or monthly precipitation series.

Value

A data.frame containing the following variables:

  • dataset is the precipitation serie name.

  • max is the maximum value in the precipitation serie.

  • max.date is the first date of the maximum precipitation serie.

  • min is the minimum value in the precipitation serie.

  • min.date is the first date of the minimum precipitation serie.

Author(s)

Lucas Venezian Povoa [email protected]

See Also

read.data as.daily

Examples

##
# Loading the monthly precipitation serie.
data(monthly)

## 
# Performing the Concentration Index Analysis
limits(monthly)

Monthly precipitation between 1950 and 1992.

Description

This dataset gives the monthly precipitation (in millimeters) between 1950 and 1992, as compiled by the National Water Agency (ANA), Brazil.

Usage

data(monthly)

Format

A data frame with 516 observations on the following 3 variables:

year

the year.

month

the month.

precipitation

the precipitation amount in millimeters.

Source

National Water Agency (ANA) http://www2.ana.gov.br/Paginas/default.aspx

Examples

data(monthly)
## maybe pci(monthly) ; rai(monthly) ...

Precipitation Concentration Degree

Description

Calculates the Precipitation Concentration Degree (PCD) on a daily or monthly precipitation serie.

Usage

pcd(object)

Arguments

object

a daily or monthly precipitation serie.

Value

A data.frame containing the following variables:

  • year is the year.

  • pcd is the percentage of precipitation concentration corresponding to a year. Values closer to 0 mean precipitation dispersion among all months and 1 concentration into only a month.

Author(s)

Lucas Venezian Povoa [email protected]

References

Zhang LJ, Qian YF (2003) Annual distribution features of precipitation in China and their interannual variations. J Acta Meteorological Sinica 17:146-163

See Also

pplot.pcd read.data as.daily as.monthly

Examples

##
# Loading the monthly precipitation serie.
data(monthly)

## 
# Performing the Precipitation Concentration Index analysis
pcd(monthly)

Precipitation Concentration Index

Description

It calculates the Precipitation Concentration Index (PCI) on a daily or monthly precipitation serie.

Usage

pci(object)

Arguments

object

a daily or monthly precipitation serie.

Value

A data.frame containing the following variables:

  • year is the year.

  • pci is the precipitation concentration index.

Author(s)

Lucas Venezian Povoa [email protected]

See Also

pplot.pci read.data as.daily as.monthly

Examples

##
# Loading the monthly precipitation serie.
data(monthly)

## 
# Performing the Precipitation Concentration Index analysis
pci(monthly)

Seasonal Precipitation Concentration Index

Description

It calculates the Precipitation Concentration Index (PCI) in a seasonal granularity on a daily or monthly precipitation serie.

Usage

pci.seasonal(object, hemisthere)

Arguments

object

is a daily or monthly precipitation serie

hemisthere

is the hemisthere, "n" for northern and "s" for south, of the precipitation serie

Value

A data.frame containing the following variables:

  • year is the year;

  • season is the meteorological season; and

  • pci.seasonal is the seasonal perceptation concentration index.

Author(s)

Lucas Venezian Povoa [email protected]

Examples

##
# Loading the daily precipitation serie
data(daily)

##
# Calculating the seasonal perceptation concentration index
pci.seasonal(daily, hemisthere = "s")

Supraseasonal Precipitation Concentration Index

Description

It calculates the supraseasonal precipitation concentration index.

Usage

pci.supraseasonal(object, hemisthere = c("n", "s"))

Arguments

object

is a daily or monthly precipitation serie.

hemisthere

is the hemisthere, "n" for northern and "s" for south, of the precipitation serie.

Value

A data.frame containing the following variables:

  • year is the year;

  • season is the meteorological supraseason, wet or dry; and

  • pci.season is the seasonal perceptation concentration index.

Author(s)

Lucas Venezian Povoa [email protected]

References

M. de Luis, J. C. Gonz\'alez-Hidalgo, M. Brunetti, L. A. Longares (2011). Precipitation concentration changes in Spain 1946-2005. Natural Hazards and Earth System Science, 5:11, pp. 1259–1265

Examples

##
# Loading the daily precipitation serie
data(daily)

##
# Calculating the supraseasonal precipitation concentration index
pci.supraseasonal(daily, hemisthere = "s")

Precipitation Concentration Period

Description

Calculates the Precipitation Concentration Period (PCP) on a daily or monthly precipitation serie.

Usage

pcp(object)

Arguments

object

a daily or monthly precipitation serie.

Value

A data.frame containing the following variables:

  • year is the year.

  • pcp is the precipitation concentration period, in degree, corresponding to a year. Results correspond to a month like below when using the 'azimuth' default values: 0 = January, 30 = February, 60 = March, ..., 300 = November, and 330 = December.

Author(s)

Lucas Venezian Povoa [email protected]

References

Zhang L.J., Qian Y.F. (2003) Annual distribution features of precipitation in China and their interannual variations. J Acta Meteorological Sinica 17:146-163

See Also

pplot.pcp read.data as.daily as.monthly

Examples

##
# Loading the monthly precipitation serie.
data(monthly)

## 
# Performing the Precipitation Concentration Degree analysis
pcd(monthly)

Percentage of Normal

Description

Calculates the Percentage of Normal (PN) on a daily or monthly precipitation serie.

Usage

pn(object, interval = 30, scale = "a")

Arguments

object

a daily or monthly precipitation serie.

interval

the number of months applied for calculating the percentage of normal.

scale

the scale used for calculating the percentage of normal, which should be either "w" for weak (not supported yet), "m" for month, "s" for season, or "d" for decades.

Value

A data.frame (precintcon.pn) containing the following variables:

  • year is the year.

  • month is the month. It exists only whether scale = "m".

  • pn is the percentage of normal.

Author(s)

Lucas Venezian Povoa [email protected]

See Also

pplot.pn read.data as.daily as.monthly

Examples

##
# Loading the monthly precipitation serie.
data(monthly)

##
# Performing the Percentage of Normal analysis
pn(monthly)

Plot deciles

Description

Plots the deciles of a precipitation serie.

Usage

pplot.deciles(..., ylab = "Precipitation", 
legend.title = "Legend", legend = NULL, 
fontsize = 10, axis.text.color = "black", 
export = FALSE, export.name = "deciles_plot.png",
width = 8.6, height = 7.5, units = "cm", grouped = FALSE)

Arguments

ylab

the text for the y axis. (Default value: "Precipitation")

legend.title

the text for the legend title. (Default value: "Legend")

legend

the text vector for the legend items. If NULL the legends will be equals to the variable names. (Default value: NULL)

fontsize

the font size value in pt. (Default value: 10)

axis.text.color

the legend colors. (Default value: "black")

export

the logical value for defining whether the graph should be export to a file or not. (Default value: FALSE)

export.name

the text for defining the exported file name. It is only used if export = TRUE. (Default value: "deciles_plot.png")

width

the number for defining the exported graph width. It is only used if export = TRUE. (Default value: 8.6)

height

the number for defining the exported graph height. It is only used if export = TRUE. (Default value: 7.5)

units

the text for defining the units of the height and width parameters. It is only used if export = TRUE. (Default value: "cm")

grouped

the logical value for defining whether the graphs should be plotted in group.

...

a set of daily or monthly precipitation serie.

Author(s)

Lucas Venezian Povoa [email protected]

See Also

deciles read.data

Examples

## Loading the monthly precipitation serie.
#
data(monthly)

## Performing the a set of statistical analysis
#
pplot.deciles(monthly)

Plot histogram

Description

Plots the histogram of a precipitation serie.

Usage

pplot.histogram(..., density = FALSE, xlab = "Precipitation (mm)", 
ylab = "Frequency", legend.title = "Legend", 
legend = NULL, fontsize = 10, axis.text.color = "black", 
export = FALSE, export.name = "histogram_plot.png", 
width = 10, height = 10, units = "cm")

Arguments

density

the logical value for defining whether the graph should be plotted with bars or lines. (Default value: FALSE)

xlab

the text for the x axis. (Default value: "Precipitation (mm)")

ylab

the text for the y axis. (Default value: "Frequency")

legend.title

the text for the legend title. (Default value: "Legend")

legend

the text vector for the legend items. If NULL the legends will be equals to the variable names. (Default value: NULL)

fontsize

the font size value in pt. (Default value: 10)

axis.text.color

the legend colors. (Default value: "black")

export

the logical value for defining whether the graph should be export to a file or not. (Default value: FALSE)

export.name

the text for defining the exported file name. It is only used if export = TRUE. (Default value: "histogram_plot.png")

width

the number for defining the exported graph width. It is only used if export = TRUE. (Default value: 10)

height

the number for defining the exported graph height. It is only used if export = TRUE. (Default value: 10)

units

the text for defining the units of the height and width parameters. It is only used if export = TRUE. (Default value: "cm")

...

a set of daily or monthly precipitation series.

Author(s)

Lucas Venezian Povoa [email protected]

See Also

read.data

Examples

##
# Loading the daily precipitation serie.
data(daily)

##
# Performing the a set of statistical analysis
pplot.histogram(daily)

Plot Lorenz's curve

Description

Plots the Lorenz's curve of a precipitation serie.

Usage

pplot.lorenz(..., interval = 1, grouped = FALSE, 
xlab = expression(sum(n[i]), i==1), ylab = expression(sum(P[i]), i==1), 
legend.title = "Legend", legend = NULL, fontsize = 10, 
axis.text.color = "black", export = FALSE, export.name = "lorenz_plot.png", 
width = 8.6, height = 7.5, units = "cm")

Arguments

interval

the interval in millimeters applied for calculating the Lorenz's curve. (Default value: 1)

grouped

the logical value for defining whether all series should be plotted in the same graph or not. (Default value: FALSE)

xlab

the text for the x axis. (Default value: expression(sum(n[i]), i==1)

ylab

the text for the y axis. (Default value: expression(sum(P[i]), i==1))

legend.title

the text for the legend title. (Default value: "Legend")

legend

the text vector for the legend items. If NULL the legends will be equals to the variable names. (Default value: NULL)

fontsize

the font size value in pt. (Default value: 10)

axis.text.color

the legend colors. (Default value: "black")

export

the logical value for defining whether the graph should be export to a file or not. (Default value: FALSE)

export.name

the text for defining the exported file name. It is only used if export = TRUE. (Default value: "histogram_plot.png")

width

the number for defining the exported graph width. It is only used if export = TRUE. (Default value: 10)

height

the number for defining the exported graph height. It is only used if export = TRUE. (Default value: 10)

units

the text for defining the units of the height and width parameters. It is only used if export = TRUE. (Default value: "cm")

...

a set of daily precipitation series.

Author(s)

Lucas Venezian Povoa [email protected]

See Also

ci read.data as.daily

Examples

##
# Loading the daily precipitation serie.
data(daily)

##
# Performing the a set of statistical analysis
pplot.ci(daily, interval = 1)

Plot Precipitation Concentration Degree

Description

Plots the Precipitation Concentraition Degre per year of a precipitation serie.

Usage

pplot.pcd(..., xlab = "Year", ylab = "PCD", 
       ylim = c(0,360), legend = NULL, fontsize = 10, axis.text.color = "black", 
       export = FALSE, export.name = "pcd_plot.png", width = 8.6, 
       height = 7.5, units = "cm")

Arguments

xlab

the text for the x axis. (Default value: "Year")

ylab

the text for the y axis. (Default value: "PCD")

ylim

the limits of the y axis. (Default value: c(0, 360))

legend

the text vector for the legend items. If NULL the legends will be equals to the variable names. (Default value: NULL)

fontsize

the font size value in pt. (Default value: 10)

axis.text.color

the legend colors. (Default value: "black")

export

the logical value for defining whether the graph should be export to a file or not. (Default value: FALSE)

export.name

the text for defining the exported file name. It is only used if export = TRUE. (Default value: "pcd_plot.png")

width

the number for defining the exported graph width. It is only used if export = TRUE. (Default value: 8.6)

height

the number for defining the exported graph height. It is only used if export = TRUE. (Default value: 7.5)

units

the text for defining the units of the height and width parameters. It is only used if export = TRUE. (Default value: "cm")

...

a set of daily or monthly precipitation series.

Author(s)

Lucas Venezian Povoa [email protected]

References

Zhang LJ, Qian YF (2003) Annual distribution features of precipitation in China and their interannual variations. J Acta Meteorological Sinica 17:146-163

See Also

pcd read.data

Examples

##
# Loading the daily precipitation serie.
data(daily)

##
# Plotting PCD index per year
pplot.pcd(daily)

Plot Precipitation Concentration Index

Description

Plots the Precipitation Concentration Index of a precipitation serie.

Usage

pplot.pci(..., xlab = "Years", ylab = "PCI", legend = NULL, 
fontsize = 10, axis.text.color = "black", export = FALSE, 
export.name = "pci_plot.png", width = 10, height = 10, units = "cm")

Arguments

xlab

the text for the x axis. (Default value: "Years"

ylab

the text for the y axis. (Default value: "PCI")

legend

the text vector for the legend items. If NULL the legends will be equals to the variable names. (Default value: NULL)

fontsize

the font size value in pt. (Default value: 10)

axis.text.color

the legend colors. (Default value: "black")

export

the logical value for defining whether the graph should be export to a file or not. (Default value: FALSE)

export.name

the text for defining the exported file name. It is only used if export = TRUE. (Default value: "pci_plot.png")

width

the number for defining the exported graph width. It is only used if export = TRUE. (Default value: 10)

height

the number for defining the exported graph height. It is only used if export = TRUE. (Default value: 10)

units

the text for defining the units of the height and width parameters. It is only used if export = TRUE. (Default value: "cm")

...

a set of daily precipitation series.

Author(s)

Lucas Venezian Povoa [email protected]

See Also

read.data

Examples

##
# Loading the daily precipitation serie.
data(daily)

##
# Performing the a set of statistical analysis
pplot.pci(daily)

Plot Precipitation Concentration Period per Year

Description

Plots the Precipitation Concentration Period per year of a precipitation serie.

Usage

pplot.pcp(..., xlab = "Year", 
       ylab = "PCP", ylim = c(0,360), legend = NULL, fontsize = 10, 
       axis.text.color = "black", export = FALSE, export.name = "pcd_plot.png", 
       width = 8.6, height = 7.5, units = "cm")

Arguments

xlab

the text for the x axis. (Default value: "Year")

ylab

the text for the y axis. (Default value: "PCD")

ylim

the limits of the y axis. (Default value: c(0, 360))

legend

the text vector for the legend items. If NULL the legends will be equals to the variable names. (Default value: NULL)

fontsize

the font size value in pt. (Default value: 10)

axis.text.color

the legend colors. (Default value: "black")

export

the logical value for defining whether the graph should be export to a file or not. (Default value: FALSE)

export.name

the text for defining the exported file name. It is only used if export = TRUE. (Default value: "pcd_plot.png")

width

the number for defining the exported graph width. It is only used if export = TRUE. (Default value: 8.6)

height

the number for defining the exported graph height. It is only used if export = TRUE. (Default value: 7.5)

units

the text for defining the units of the height and width parameters. It is only used if export = TRUE. (Default value: "cm")

...

a set of daily or monthly precipitation series.

Author(s)

Lucas Venezian Povoa [email protected]

References

Zhang LJ, Qian YF (2003) Annual distribution features of precipitation in China and their interannual variations. J Acta Meteorological Sinica 17:146-163

See Also

pcp read.data

Examples

##
# Loading the daily precipitation serie.
data(daily)

##
# Plotting PCP per year
pplot.pcp(daily)

Plot Percent of Normal

Description

Plots the Percent of Normal of a precipitation serie.

Usage

pplot.pn(..., interval = 30, scale = "a", xlab = NA, ylab = "PN", 
         fontsize = 10, axis.text.color = "black", legend = NULL, 
         export = FALSE, export.name = "pn_plot.png", width = 10, 
         height = 10, units = "cm")

Arguments

interval

the number of months applied for calculating the percentage of normal.

scale

the scale used for calculating the percentage of normal, which should be either "w" for weak (not supported yet), "m" for month, "s" for season, or "d" for decades.

xlab

the text for the x axis. (Default value: NA)

ylab

the text for the y axis. (Default value: "PN")

fontsize

the font size value in pt. (Default value: 10)

axis.text.color

the legend colors. (Default value: "black")

legend

the text vector for the legend items. If NULL the legends will be equals to the variable names. (Default value: NULL)

export

the logical value for defining whether the graph should be export to a file or not. (Default value: FALSE)

export.name

the text for defining the exported file name. It is only used if export = TRUE. (Default value: "pci_plot.png")

width

the number for defining the exported graph width. It is only used if export = TRUE. (Default value: 10)

height

the number for defining the exported graph height. It is only used if export = TRUE. (Default value: 10)

units

the text for defining the units of the height and width parameters. It is only used if export = TRUE. (Default value: "cm")

...

a set of daily or monthly precipitation serie.

Author(s)

Lucas Venezian Povoa [email protected]

See Also

read.data

Examples

##
# Loading the daily precipitation serie.
data(daily)
   
##
# Performing the a set of statistical analysis
pplot.pn(daily)

Plot Rainfall Anomaly Index

Description

Plots the Rainfall Anomaly Index of a precipitation serie.

Usage

pplot.rai(..., granularity = "m", xlab = "Month", ylab = "RAI", 
					 ylim = c(-3,3), legend = NULL, fontsize = 10, 
                axis.text.color = "black", export = FALSE, 
					 export.name = "rai_plot.png", width = 8.6, 
				    height = 7.5, units = "cm")

Arguments

granularity

the granularity applied for calculating the rainfall anomaly index, which should be either "a" for annual granularity or "m" for monthly granularity ". (Default value: "m")

xlab

the text for the x axis. (Default value: "Month")

ylab

the text for the y axis. (Default value: "RAI")

ylim

the limits of the y axis. (Default value: c(-3, 3))

legend

the text vector for the legend items. If NULL the legends will be equals to the variable names. (Default value: NULL)

fontsize

the font size value in pt. (Default value: 10)

axis.text.color

the legend colors. (Default value: "black")

export

the logical value for defining whether the graph should be export to a file or not. (Default value: FALSE)

export.name

the text for defining the exported file name. It is only used if export = TRUE. (Default value: "rai_plot.png")

width

the number for defining the exported graph width. It is only used if export = TRUE. (Default value: 8.6)

height

the number for defining the exported graph height. It is only used if export = TRUE. (Default value: 7.5)

units

the text for defining the units of the height and width parameters. It is only used if export = TRUE. (Default value: "cm")

...

a set of daily or monthly precipitation series.

Author(s)

Lucas Venezian Povoa [email protected]

References

Rooy, M. P. van. A Rainfall anomaly index independent of time and space, Notos. v.14, p.43-48, 1965.

See Also

read.data

Examples

##
# Loading the daily precipitation serie.
data(daily)

##
# Performing the a set of statistical analysis
pplot.rai(daily, granularity = "m")

Plot Standardized Precipitation Index

Description

Plots the Standardized Precipitation Index of a precipitation serie.

Usage

pplot.spi(..., period = 3, distribution = "Gamma", xlab = "Months",
ylab = "SPI", ylim = c(-3,3), legend = NULL, fontsize = 10, 
axis.text.color = "black", export = FALSE, export.name = "spi_plot.png", 
width = 8.6, height = 7.5, units = "cm")

Arguments

period

the number of months to be aggregated for calculating the standardized precipitation index. (Default value: 3)

distribution

it has no effect yet. (Default value: "Gamma")

xlab

the text for the x axis. (Default value: "Months")

ylab

the text for the y axis. (Default value: "SPI")

ylim

the limits of the y axis. (Default value: c(-3, 3))

legend

the text vector for the legend items. If NULL the legends will be equals to the variable names. (Default value: NULL)

fontsize

the font size value in pt. (Default value: 10)

axis.text.color

the legend colors. (Default value: "black")

export

the logical value for defining whether the graph should be export to a file or not. (Default value: FALSE)

export.name

the text for defining the exported file name. It is only used if export = TRUE. (Default value: "spi_plot.png")

width

the number for defining the exported graph width. It is only used if export = TRUE. (Default value: 8.6)

height

the number for defining the exported graph height. It is only used if export = TRUE. (Default value: 7.5)

units

the text for defining the units of the height and width parameters. It is only used if export = TRUE. (Default value: "cm")

...

a set of daily or monthly precipitation series.

Author(s)

Lucas Venezian Povoa [email protected]

See Also

read.data

Examples

##
# Loading the daily precipitation serie.
data(daily)

##
# Performing the a set of statistical analysis
pplot.spi(daily)

Precipitation Intensity, Concentration and Anomaly Analysis

Description

It contains functions to analyze the precipitation intensity, concentration and anomaly.

Author(s)

Lucas Venezian Povoa [email protected]

Jonas Teixeira Nery [email protected]

References

Michael J. Hayes (2015). Comparison of Major Drought Indices. National Drought Mitigation Center. http://goo.gl/skHfs9.

Gibbs, W. J. (1967). Rainfall deciles as drought indicators. Bureau of Meteorology Bulletin, n. 48. Commonwealth of Australia.

Luis, M. D., Gonzolez-Hidalgo, J. C., Brunetti, M., Longares, L. A. (2011). Precipitation concentration changes in Spain 1946-2005. Natural Hazards and Earth System Science, v. 11, n. 5, p. 1259–1265.

Martin-Vide, J. (2004). Spatial distribution of a daily precipitation concentration index in peninsular Spain. International Journal of Climatology, v. 24, n. 8, p. 959–971.

Guttman, N. B. (1999). Accepting the standardized precipitation index: a calculation algorithm. Journal of the American Water Resources Association, v. 35, n. 2, p. 311–322. Blackwell Publishing Ltd.

Barring, L., Hulme, M. (1991). Filters and approximate confidence intervals for interpreting rainfall anomaly indices. Journal of climate, v. 4, n. 8, p. 837–847.


Rainfall Anomaly Index

Description

Calculates the Rainfall Anomaly Index (RAI) on a daily or monthly precipitation serie.

Usage

rai(object, granularity = "m")

Arguments

object

a daily or monthly precipitation serie.

granularity

the granularity applied for calculating the rainfall anomaly index, which should be either "m" for monthly granularity or "a" for annual granularity. (Default value: "m")

Value

A data.frame (precintcon.rai) containing the following variables:

  • year is the year.

  • month is the month. This attribute exists only when granularity = "m".

  • rai is the rainfall anomaly index.

Author(s)

Lucas Venezian Povoa [email protected]

References

Van Rooy, M. P. "A rainfall anomaly index independent of time and space." Notos 14.43 (1965): 6.

See Also

pplot.rai read.data

Examples

##
# Loading the monthly precipitation serie.
data(monthly)

##
# Performing the Rainfall Anomaly Index analysis
rai(monthly, granularity = "m")

Load a precipitation series

Description

Load a file with a daily or monthly precipitation series.

Usage

read.data(file, sep = ",", dec = ".", header = TRUE, na.value = NA)

Arguments

file

a string containing the file path.

sep

the character applied for delimited columns. (Default value: ",")

dec

the character applied for defined decimal point. (Default value: ".")

header

a logical value defining whether the first line of the file refers to column names. (Default value: TRUE)

na.value

the value used for representing missing values. (Default value: NA)

Value

A data frame containing a representation of the data in the file. The file is addressed as precintcon.daily or precintcon.monthly depending of its structure.

The file should contains three columns when loading monthly series and thirty three columns when loading daily series.

The first columns refers to years and the second one refers to months. When dealing with daily datasets, the thirty one remaining columns refers to the amount of precipitation in the days of the months. Otherwise, the remaining column refers to the amount of precipitation in each month.

Author(s)

Lucas Venezian Povoa [email protected]

See Also

daily monthly read.table read.csv read.csv2

Examples

##
# Loading a serie on Windows
## Not run: d1 <- read.data("C:\PRECINTCON\203040.csv", sep = ";", dec = ".", header = TRUE)

##
# Loading a serie on Unix-like
## Not run: d1 <- read.data("/home/precintcon/203040.csv", sep = ";", dec = ".", header = TRUE)

Standardized Precipitation Index

Description

Calculates the Standardized Precipitation Index (SPI) on a daily or monthly precipitation serie.

Usage

spi(object, period = 3, distribution = "Gamma")

Arguments

object

a daily or monthly precipitation serie.

period

the number of months to be aggregated in the calculation of the standardized precipitation index. (Default value: 3)

distribution

it has no effect yet. (Default value: "Gamma")

Value

A data.frame (precintcon.spi) containing the following variables:

  • year is the year.

  • month is the month.

  • spi is the standardized precipitation index.

Author(s)

Lucas Venezian Povoa [email protected]

See Also

precintcon.plot.spi read.data

Examples

##
# Loading the monthly precipitation serie.
data(monthly)

##
# Performing the Standardized Precipitation Index
spi(monthly, period = 3)

Standardized Precipitation Index

Description

Calculates the Standardized Precipitation Index (SPI) per year on a daily or monthly precipitation serie.

Usage

spi.per.year(object, period = 3, distribution = "Gamma", FUN = mean)

Arguments

object

a daily or monthly precipitation serie.

period

the number of months to be aggregate in the calculation of the standardized precipitation index. (Default value: 3)

distribution

(it has no effect yet).

FUN

the function used to summarize the standardized precipitation index per year. (Default function: mean).

Value

A data.frame (precintcon.spi.per.year) containing the following variables:

  • year is the year.

  • spi is the standardized precipitation index.

Author(s)

Lucas Venezian Povoa [email protected]

See Also

spi read.data

Examples

##
# Loading the monthly precipitation serie.
data(monthly)

##
# Performing the Standardized Precipitation Index
spi.per.year(monthly, period = 3)

Basic statistics for precipitation datasets.

Description

Perform the calculation of basic statistics of precipitation datasets.

Usage

stat(...)

Arguments

...

a set of daily or monthly precipitation serie.

Value

A data.frame (precintcon.stat) containing the following variables:

  • dataset is the precipitation serie name.

  • mean.daily is the daily average precipitation. It exists only for daily datasets.

  • sd.daily is the standard deviation of a daily precipitation serie. It exists only for daily datasets.

  • var.daily is the variance of a daily precipitation serie. It exists only for daily datasets.

  • mean.monthly is the monthly average precipitation.

  • sd.monthly is the standard deviation of a monthly precipitation serie.

  • var.monthly is the variance of a monthly precipitation serie.

  • total is the total precipitation.

Author(s)

Lucas Venezian Povoa [email protected]

Examples

##
# Loading the monthly precipitation serie.
data(monthly)

##
# Plotting the deciles.
stat(monthly)

Temporaly Irregularity Index

Description

It calculates the temporaly irregularity index according to the function sum(log(Pi+1/Pi))/(n-1), where Pi is the precipitation amount of year i, and n is the number of years.

Usage

tii(object)

Arguments

object

is a daily or monthly precipitation serie

Details

Daily or monthly precipitation series are transformed to annual series.

Value

the temporaly irregularity index according to the function sum(log(Pi+1/Pi))/(n-1)

Author(s)

Lucas Venezian Povoa

Examples

##
# Loading the monthly precipitation serie
data(monthly)

##
# Calculationg the Temporaly Irregularity Index
tii(monthly)

Mann-Kendall Trend Test

Description

It calculates a trend test using the rank-based nonparametric Mann-Kendall method.

Usage

trend.test(object, significance.level = 0.05)

Arguments

object

is a daily or monthly precipitation serie.

significance.level

is the significance level to be considered in the analysis. It is usually equals to 5% (default: 0.05).

Value

A trend test index.

Author(s)

Lucas Venezian Povoa [email protected]

References

H. B. Mann (1945). Nonparametric tests against trend. Econometrica, vol. 13, pp. 245-259. M. G. Kendall (1975). Rank Correlation Methods. Griffin, London, UK.

See Also

ci ci.per.year pci read.data