getSpatialMap_mat {hyfo} | R Documentation |
Replot raster matrix
Description
replot the matrix output from getSpatialMap
, when output = 'data'
or output is default
value.
Usage
getSpatialMap_mat(
matrix,
title_d = NULL,
catchment = NULL,
point = NULL,
output = "data",
name = NULL,
info = FALSE,
scale = "identity",
color = NULL,
...
)
Arguments
matrix |
A matrix raster, should be the result of |
title_d |
A string showing the title of the plot, defaut is NULL. |
catchment |
A catchment file geting from |
point |
A dataframe, showing other information, e.g., location of the gauging stations. The the data.frame should be with columes "name, lon, lat, z, value". |
output |
A string showing the type of the output, if |
name |
If |
info |
A boolean showing whether the information of the map, e.g., max, mean ..., default is FALSE. |
scale |
A string showing the plot scale, 'identity' or 'sqrt'. |
color |
Most of time you don't have to set this, but if you are not satisfied with the
default color, you can set your own palette here. e.g., |
... |
|
Value
A matrix representing the raster map is returned, and the map is plotted.
References
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/.
Hadley Wickham (2007). Reshaping Data with the reshape Package. Journal of Statistical Software, 21(12), 1-20. URL http://www.jstatsoft.org/v21/i12/.
Hadley Wickham (2011). The Split-Apply-Combine Strategy for Data Analysis. Journal of Statistical Software, 40(1), 1-29. URL http://www.jstatsoft.org/v40/i01/.
Original S code by Richard A. Becker and Allan R. Wilks. R version by Ray Brownrigg. Enhancements by Thomas P Minka <tpminka at media.mit.edu> (2015). maps: Draw Geographical Maps. R package version 2.3-11. https://CRAN.R-project.org/package=maps
Pebesma, Edzer, and Roger Bivand. 2023a. Sp: Classes and Methods for Spatial Data. https://CRAN.R-project.org/package=sp.
Roger Bivand and Colin Rundel (2015). rgeos: Interface to Geometry Engine - Open Source (GEOS). R package version 0.3-11. https://CRAN.R-project.org/package=sf
Examples
## Not run:
data(tgridData)# the result of \code{loadNcdf}
#the output type of has to be default or 'data'.
a1 <- getSpatialMap(tgridData, method = 'mean')
a2 <- getSpatialMap(tgridData, method = 'max')
a3 <- getSpatialMap(tgridData, method = 'winter')
a4 <- getSpatialMap(tgridData, method = 'summer')
#For example, if we want to investigate the difference between mean value and max.
a5 <- a2 - a1
getSpatialMap_mat(a4)
#Or to investigate the difference between winter value and summer value.
a6 <- a3 - a4
getSpatialMap_mat(a6)
## End(Not run)
# More examples can be found in the user manual on https://yuanchao-xu.github.io/hyfo/