[R-sig-Geo] Help converting matlab raster to R raster brick
cmundy
Craig.Mundy at utas.edu.au
Thu Apr 4 16:00:08 CEST 2013
Hi All,
I have been provided with a .mat file containing a time series of Sea
Surface Temperature data (50 x 42 cells with 92 time layers). It was a
"Struct" object in Matlab. I can happily import the file in to R using
R.matlab, creating a list as follows. My question is how then to convert
this to a raster brick?
Thanks
Craig
> library(R.matlab)
> test <- readMat("CraigMundy.mat")
> str(test)
List of 2
$ data :List of 9
..$ : num [1, 1:92] 734138 734139 734140 734141 734142 ...
..$ : num [1:50, 1:42, 1:92] 14.4 14.5 15.2 15.3 14.8 ...
..$ : num [1:50, 1] -44.3 -44.3 -44.3 -44.2 -44.2 ...
..$ : num [1, 1:42] 147 147 147 147 147 ...
..$ : num [1, 1] 101
..$ : chr [1, 1] " SST: 3 Day Composite"
..$ : num [1, 1] 0
..$ : num [1, 1] 34.5
..$ : num [1, 1] 0.44
..- attr(*, "dim")= int [1:3] 9 1 1
..- attr(*, "dimnames")=List of 3
.. ..$ : chr [1:9] "Time" "Values" "Lat" "Long" ...
.. ..$ : NULL
.. ..$ : NULL
$ times: chr [1:92, 1] "31-Dec-2009" "01-Jan-2010" "02-Jan-2010"
"03-Jan-2010" ...
- attr(*, "header")=List of 3
..$ description: chr "MATLAB 5.0 MAT-file, Platform: PCWIN64, Created on:
Thu Apr 04 11:29:53 2013 "
..$ version : chr "5"
..$ endian : chr "little"
> version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 0.0
year 2013
month 04
day 03
svn rev 62481
language R
version.string R version 3.0.0 (2013-04-03)
nickname Masked Marvel
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Help-converting-matlab-raster-to-R-raster-brick-tp7583204.html
Sent from the R-sig-geo mailing list archive at Nabble.com.
More information about the R-sig-Geo
mailing list