sl.lonlat1Dto2D | R Documentation |
Inflate latitude and/or longitude vectors to corresponding matrices. By default, rows correspond to latitudes and columns correspond to longitudes; this can be changed by setting swap=TRUE
. If only one vector (longitudes or latitudes) is provided, the number of latitudes or longitudes to which the vector shall be inflated must be provided.
sl.lonlat1Dto2D(lon = NULL, lat = NULL, Nlon = NULL, Nlat = NULL, swap = FALSE)
lon |
a vector with longitudes. |
lat |
a vector with latitudes. |
Nlon |
a scalar giving the number of longitudes to which the latitudes vector shall be inflated. Used only if |
Nlat |
a scalar giving the number of latitudes to which the longitudes vector shall be inflated. Used only if |
swap |
a logical value indicating whether the rows and columns of the output shall be swapped. By default ( |
lon |
a matrix giving longitudes, inflated from the argument |
lat |
a matrix giving latitudes, inflated from the argument |
Helge Goessling
sl.lonlat1Dto2D(lon=seq(-150,150,60),lat=c(-60,60,60))
## Should return:
## $lon
## [,1] [,2] [,3] [,4] [,5] [,6]
## [1,] -150 -90 -30 30 90 150
## [2,] -150 -90 -30 30 90 150
## [3,] -150 -90 -30 30 90 150
##
## $lat
## [,1] [,2] [,3] [,4] [,5] [,6]
## [1,] -60 -60 -60 -60 -60 -60
## [2,] 60 60 60 60 60 60
## [3,] 60 60 60 60 60 60
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.