Displaying 20 results from an estimated 29 matches for "readmat".
2011 Mar 13
4
readMat - how to retrieve the variables
...lo
I have a matlab MAT file that contains one single variable: a. The
structure of a is as follows:
a.river1.flow (flow values)
a.river1.date_flow (date)
a.river1.precip (precipitation values)
a.river1.date_precip
a.river2.flow
a.river2.date_flow
a.river2.precip
a.river2.date_precip
I have used readMat to load the variable a in R, however I have no idea how
readMat translates a. I managed to get some values out of
data=readMat("matfile.mat")
data$a[,,1]$river1[,,1]$flow -> Why do I need [,,1]? Why not
data$a$river1$flow?
Many thanks
Ed
2008 Oct 18
1
Error: could not find function "readMat"
...p="")
+
+ pattern <- sprintf("-v%d.mat$", version)
+ filenames <- list.files(pattern=pattern, path=path, full.names=TRUE)
+
+ for (filename in filenames) {
+ cat("Reading MAT file: ", basename(filename), "\n", sep="")
+ mat <- readMat(filename)
+ if (interactive()) {
+ cat("Press ENTER to view data:")
+ readline()
+ }
+ print(mat)
+ }
+ }
it gives the following output.
Loading all MAT v4 example files in
/home/atul/R/x86_64-pc-linux-gnu-library/2.6/R.matlab/mat-files...
Reading MAT file: Mat...
2012 Aug 14
1
Help needed in reading matlab files
Dear users,
I am stucked with a programming problem: I am trying to download a squared adjacency matrix from matlab with only 0 or 1. Doing it without a loop at first, I get an error message that is, I think, related to the "mat_adj<-readMat(pathnames_adj)" line. Did anybodz encouter already that problem? If so, do I need to change anything in my code in order it not to be recurrent? If I run the code a second time, it works fine, but this does not help me, as I try to set up a loop for 265 matlab adj matrix, each number represent...
2008 Mar 26
2
Moving data between R and Matlab back and forth?
...o find a way to painlessly move structured data back and
forth between R and Matlab (also Octave). For this purpose I found the
R.matlab package great help. I wish to use a Matlab -v6 MAT file as an
intermediary format, because it is well read by both Matlab and
Octave. It is also well read by 'readMat' function in R.matlab
package, but that is where I run into problems because of poor
knowledge of R.
By structured data I mean data in data frames in R and the closest
equivalent - structures in Matlab. Here is what I have done.
-----------------------------------------------------
Make a dat...
2008 Jan 30
2
[rfc] Package to access the internal zlib library.
To make R.matlab's readMat work for me[1] I needed access to zlib's
uncompress function. R already links with zlib, and sometime last
year I hobbled together a quick package to get at a few functions.
It's my first package, so I would love feedback both on the package
and its purpose.
I've dropped a temporary c...
2010 Dec 19
2
R.matlab memory use
...ading required package: R.oo
Loading required package: R.methodsS3
R.methodsS3 v1.2.0 (2010-03-13) successfully loaded. See ?R.methodsS3 for help.
R.oo v1.7.2 (2010-04-13) successfully loaded. See ?R.oo for help.
R.matlab v1.3.1 (2010-04-20) successfully loaded. See ?R.matlab for help.
> f <- readMat("freq.mat")
Error: cannot allocate vector of size 296.5 Mb
On the other hand, if I save the same data in ascii format (from
octave: "save -text"), resulting in a 75MB file, then I can load it
without problems with the read.octave() function from package foreign.
Is this a known...
2010 Jun 10
1
importing multidimensional matrix from MATLAB
Hi,
Suppose I have a matrix of size 256x14x32 in MATLAB. I want to import
that into R. I used readMat and then do.call. But the variable is
stored as an array as its done in R. However, I want to define a
variable W=array(0,c(256,14,32)) in R and read the multidimensional
matlab variable into W. I am not able to do this in R. Please, could
you help ?
Thanks
Gopi
[[alternative HTML version delete...
2007 Nov 17
3
R and reading matlab compressed files
Is there any way to read these files (standard .mat files, created by
matlab version 7 onwards are compressed)? I know that R.matlab doesn't
read them (it even says in the file MatlabServer.m "Matlab v7 saves
compressed files, which is not recognized by R.matlab's readMat()" (lines
47-8)).
I know I should be able to make R call Matlab and transfer data (not that
I managed to make it work yet!), but I'd rather not run Matlab & R
together: I'd like to use R to read matlab files on machines not licensed
for matlab!
Are there any ways to make this wor...
2010 Aug 27
8
R.matlab package help
...ERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] R.utils_1.5.0 R.matlab_1.3.1 R.oo_1.7.3 R.methodsS3_1.2.0
> traceback()
5: file(con, open = "rb")
4: readMat.default(filename)
3: readMat(filename)
2: getVariable.Matlab(matlab, "B")
1: getVariable(matlab, "B")
Thanks,
Michael
2011 Feb 18
1
reading a matlab file
Dear R-people,
I am trying to read a matlab file, unfortunately without success. I enclosed the zipped file.
Do you have an idea how to read this file by ReadMat package into the R system?
Thanks for your time!
Wim Krijnen
2012 Oct 09
1
converting dgCMatrix to regular matrix
Hi: I've looked around and I must be missing it because it's probably
somewhere. Does someone know how to convert an object of class dgCmatrix
to a regular matrix. I can send someone the data if they need it but it's
too big to include here.
I read the data in using
temp<-readMat("movielens.mat")
where readMat is from the R.matlab package. But the resulting 2 matrices
are S4 object of class dgCmatrix with 6 slots shown below. In the end, I'd
actually want to put the 18000 elements of the second matrix into the
appropriate locations of the first matrix ( firs...
2011 Jul 13
3
Rcompression on MAC - where is it?
Hello
I need to run an r-file that works on Windows on MAC. The first lines of the file are:
library(R.matlab)
library(Rcompression)
Somehow I cannot find where Rcompression is. Am I missing something?
Many thanks
Ed
2006 Dec 22
2
Pb with R.matlab
Hello,
I have problems running the R.matlab package. I work with R 2.3.1, under
windows (using the Rgui). It seems that, even after loading the package,
the "simple" functions such as writeMat() or readMat() are not recognized.
For example, the following script leads to an error:
> install.packages("R.matlab")
--- Please select a CRAN mirror for use in this session ---
essai de l'URL
'http://cran.miroir-francais.fr/bin/windows/contrib/2.3/R.matlab_1.1.2.zip'
Content type &...
2008 Sep 27
1
writeMat error
.../tmp/R*
I tried both current version of R.matlab and older version because of bug
https://stat.ethz.ch/pipermail/r-help/2008-September/173432.html
A <- matrix(1:27, ncol=3)
B <- as.matrix(1:10)
fn <- paste(tempfile(), ".mat", sep="")
writeMat(fn, A=A, B=B)
data <- readMat(fn)
print(data)
unlink(fn)
onWrite <- function(x)
writeBin(x$length, con=x$con, size=4, endian="big");
writeMat(fn, A=A, B=B, onWrite=onWrite)
Does generate a file in /tmp/Rtmpjhfjxw
-rw-r--r-- 1 dst dst 396 2008-09-27 12:46 file643c9869.mat
When I try to read it into Matlab I get...
2008 Oct 28
1
Saving a 3d array into a matlab file
Dear R users,
I am tryting to save an 3d array to a matlab file like the following.
A <- array(1:24, c(2,3,4))
writeMat(filename, A=A)
But if I load the mat file from Matlab, it is not 3d matrix anymore.
Does anyone know how I can preserve the 3d structure?
Any help will be greatly appreciated.
Minho Chae
[[alternative HTML version deleted]]
2011 Oct 17
0
[Reading mat files into R]
Dear R users,
I work with Matlab & R simultaneously. Usually I used to read successfully
mat files (cell, structure, etc.) into R, till Matlab 2011b release.
For reading mat files (or maybe I should say, converting it into R variable
or structure) I’m using *readMat* (from “R.matlab” package).
Even saving mat files in one of the previous formats (which can bet set in
preference panel) didn’t resolve my problem.
When I want to load mat file, created by Matlab 2011b release by using
following commands:
*require(R.matlab)*
*require(utils)*
*require(Rcom...
2009 Oct 30
1
problems with re-loading exported data
Hello,
I have a data file originally as .mat file from matlab that I imported
in R using the R.matlab package (readMat). This loaded a list
containing amongst other things a 4x4 array of rainfall data that is
quite heavy (around 40 Mb, it took 10 minutes to load on my computer).
I tried to export it as R data file or simply a text file (using the
command write) to share this data with other R users. When I...
2011 Jun 29
3
4D data acsess
Hi, I have a 4D data file from MATLAB, call it X, that I want to analyze in
R. The first 3 dimensions are x y z coordinates and the forth is a value in
time.
If you took a sample vector in matlab it would look like
vec1 = X(x1, y1, z1, :)
vec2 = X( x2, y2, z2, :)
this would give you all values (I have 300 of them) corresponding to this
(x1,y1,z1) point of X.
Now I read the MATLAB datafile 4D
2012 Aug 22
3
help
...would like indeg1, indeg2,...,indeg265.
Rm(list())
library(R.matlab)
library(igraph)
path<-("D:/adj_matrices/nonweighted_GOVSOV")
setwd(path)
vector.files<-paste("nonweighted_GOVSOV",1:265, ".mat",sep="")
dat<-list()
for(i in 1:265) {
dat[[i]] <-readMat(file.path(path,vector.files[i]))
adj<-do.call(rbind, dat[[i]])
g<-graph.adjacency(adj, mode=c("directed"), weighted=T) # the graph object of the network
a<-length(V(g)) #the number of nodes
indeg<-rep(0,a)...
2010 Oct 28
2
R and Matlab
Dear Group,
I am looking for ways to use R and Matlab. Doing the data transformations in
R and using the data in Matlab to analyze with some pre-defined scripts.
Any good ways to transfer the data into matlab in its most recent version?
I tried using R.matlab but the writeMat output is not readable by Matlab.
I just need to output a data.frame and read it as is into matlab where I can
do any