getPreciBar | R Documentation |
get mean rainfall bar plot of the input dataset or time series.
getPreciBar(
data,
method,
cell = "mean",
output = "data",
name = NULL,
plotRange = TRUE,
member = NULL,
omitNA = TRUE,
info = FALSE,
...
)
## S4 method for signature 'list'
getPreciBar(
data,
method,
cell = "mean",
output = "data",
name = NULL,
plotRange = TRUE,
member = NULL,
omitNA = TRUE,
info = FALSE,
...
)
## S4 method for signature 'data.frame'
getPreciBar(
data,
method,
cell = "mean",
output = "data",
name = NULL,
plotRange = TRUE,
member = NULL,
omitNA = TRUE,
info = FALSE,
...
)
data |
A list containing different information, should be the result of reading netcdf file using
|
method |
A string showing the calculating method of the input time series. More information please refer to the details. |
cell |
A vector containing the locaton of the cell, e.g. c(2, 3), default is "mean", representing the spatially averaged value. Check details for more information. |
output |
A string showing the type of the output, if |
name |
If |
plotRange |
A boolean showing whether the range will be plotted. |
member |
A number showing which member is selected to get, if the dataset has a "member" dimension. Default is NULL, if no member assigned, and there is a "member" in dimensions, the mean value of the members will be taken. |
omitNA |
A boolean showing whether the missing value is omitted. |
info |
A boolean showing whether the information of the map, e.g., max, mean ..., default is FALSE. |
... |
|
There are following methods to be selected, "annual": annual rainfall of each year is plotted. "winter", "spring", "autumn", "summer": seasonal rainfall of each year is plotted. Month(number 1 to 12): month rainfall of each year is plotted, e.g. march rainfall of each year. "meanMonthly": the mean monthly rainfall of each month over the whole period.
#Since "winter" is a crossing year, 12, 1, 2, 12 is in former year, and 1, 2 are in latter year. #so winter belongs to the latter year.
cell
representing the location of the cell, NOTE: this location means the index of the cell,
IT IS NOT THE LONGITUDE AND LATITUDE. e.g., cell = c(2, 3)
, the program will take the 2nd longitude
and 3rd latitude, by the increasing order. Longitude comes first.
It is a generic function, if in your case you need to debug, please see ?debug()
for how to debug S4 method.
The calculated mean value of the input time series and the plot of the result.
Hadley Wickham (2007). Reshaping Data with the reshape Package. Journal of Statistical Software, 21(12), 1-20. URL http://www.jstatsoft.org/v21/i12/.
H. Wickham. ggplot2: elegant graphics for data analysis. Springer New York, 2009.
R Core Team (2015). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL https://www.R-project.org/.
#gridData provided by package is the result of \code{loadNcdf()}
data(tgridData)
b1 <- getPreciBar(tgridData, method = 'annual')
b2 <- getPreciBar(tgridData, method = 'meanMonthly')
data(testdl)
TS <- testdl[[1]]
a <- getPreciBar(TS, method = 'spring')
# if info = T, the information will be given at the bottom.
a <- getPreciBar(TS, method = 'spring', info = TRUE)
# More examples can be found in the user manual on https://yuanchao-xu.github.io/hyfo/
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.