Displaying 20 results from an estimated 8000 matches similar to: "Equivalents of Matlab's 'find' and 'end'"
2007 May 07
1
looking for equivalent of matlab's medfilt1 function
Dear all,
I have several files with Matlab code, which I am translating to R.
For the zero-level approach, I took the very old shell script from R-help
archives, which has made some obvious leg-work such as replacement of "="
with "<-".
Now I am translating indexing, matrix operations and function call using
this table
http://37mm.no/mpy/octave-r.html
The problem is, I
2009 Dec 24
3
Newbie: colSums() compared with Matlab's sum()
Hi all,
I'm trying to learn R after years of Matlab's experience. Here is an
issue I couldn't solve today.
Consider the following piece of code (written by memory):
for(i in 1:n){
submat <- data[1:i,]
C <- colSums(submat)
}
The problem is that at the first iteration, data[1:1,] reduces to a
vector and colSums returns an error. This sounds really strange to me
2007 Sep 07
2
Matlab's lsqnonlin
Hi! I'm translating some code from Matlab to R and I found a problem.
I need to translate Matlab's function 'lsqnonlin'
(http://www-ccs.ucsd.edu/matlab/toolbox/optim/lsqnonlin.html) into R,
and at the beginning I thought it would be the same as R's 'optim'. But
then I looked at the definition of 'lsqnonlin' and I don't quite see how
to make
2007 Jul 16
1
R equivalent to Matlab's Bayes net toolbox
Hi,
I'm attending summer School at UCLA (IPAM) on "probabilistics models of
cognition". I have been an R-user since v. 1.4.1, but was trained in the
frequentist tradition (as most psychologists!). I found that all faculty
here use matlab and Murphy's bayes net toolbox. I have not had the need to
use matlab before, and would love to stick to R for graphics models and
2006 Jun 12
1
r's optim vs. matlab's fminsearch
Hi,
I'm having a problem converting a Matlab program into R. The R code works
almost all the time, but about 4% of the time R's optim function gets stuck
on a local minimum whereas matlab's fminsearch function does not (or at
least fminsearch finds a better minimum than optim). My understanding is
that both functions default to Nelder-Mead optimization, but what's
different about
2012 Dec 22
4
Does R have an equivalent for Matlab's cell array?
Hi
I have a time series of measurements: every 10 min. a value was logged.
The data look like:
20100914 08:01 3.74
20100914 08:11 3.74
20100914 08:21 3.71
20100914 08:31 4.39
20100914 08:41 3.74
This data spans several months.
I would like to group the data per day. In Matlab it is fairly easy to
obtain a cell array, of which the first column contains the date of each
2009 Jun 30
2
Equivalent to Matlab's "Ans"
Hi everyone,
I was just wondering if there is an equivalent in R to the shortcut "Ans" in
MatLab whereby I can use the previous result for the current command? This
could save a lot of time when hacking in R itself, not from an editor.
Thanks,
Stephane
[[alternative HTML version deleted]]
2009 Jan 30
3
Matlab inv() and R solve() differences
I submit the following matrix to both MATLAB and R
x= 0.133 0.254 -0.214 0.116
0.254 0.623 -0.674 0.139
-0.214 -0.674 0.910 0.011
0.116 0.139 0.011 0.180
MATLAB's inv(x) provides the following
137.21 -50.68 -4.70 -46.42
-120.71 27.28 -8.94 62.19
-58.15 6.93 -7.89 36.94
8.35 11.17 10.42 -14.82
R's solve(x) provides:
261.94 116.22 150.92 -267.78
116.22 344.30 286.68
2007 Jun 26
4
Looking for parallel functionality between Matlab and R
I'm slowly moving my statistical analysis from Matlab to R, and find myself
missing two features:
a) How do I mimic Matlab's 'hold on'? (I want to show several plots
together, when I type two plots one after the other the second overwrites
the first)
b) How do I mimic Matlab's 'axis'? (after drawing my plots I want to zoom on
specific parts- for example, x=0:5,
2008 Jul 29
2
R command history -- can it be like Matlab's?
Hi all,
In R GUI window, if you use "up" and "down" key, you will be able to recall
the previous and next command that has been used and stored in the command
history cache.
But there is one inconvenience:
In Matlab, you can type the first a few characters of the command that you
previously used,
and then press ?up" key, you will be able to get to that previous
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
2006 Jan 25
7
reducing learning curves?
Hi all,
I am really new to the R language. I am a long time Matlab and C++ user and
I was "forced" to learn R because I am taking a statistics class.
I am seeking to reduce the learning curve to as smooth as possible.
Are there any addon/plug-in features that can reduce the learning curve, for
example, the following features can be very helpful for new learners:
1. Matlab-like
2007 Sep 11
5
Percentiles in R
Hi there! Still struggling to translate Matlab code into R's tsDyn package.
Here is my question: Is there in R an equivalent function to Matlab's
prctile()? To the moment I thought it was quantile(), but I just
realized I was wrong. The definition of the Matlab function:
prctile
Percentiles of a sample
SyntaxY = prctile(X,p)
Description
Y = prctile(X,p) calculates a value that is
2007 Jun 19
1
Iterative Solver [Converting Matlab's solve()]
I can't for the life of me figure out how to get the roots for this simple
(but sovable only iteratively) equation in R:
x = z*(1-(1-2/z)^y
where x and y are known, and z is unknown. In Matlab, this amounts to:
[my.solution] = solve('x = z*(1-(1-2/z)^y')
my.solution.real = solution(y-1,y)
% bottom line displays non-imaginary solution (last element)
Obviously, I'm deeply
2011 Jul 17
3
How to convert number (matlab) to date
Hello
I am new to R and I need to convert some dates (numeric format by matlab) to actual dates in R.
For instance,
Matlab -> 730456 -> >> datestr(730456)
ans =
02-Dec-1999
R -
> library(zoo)
> as.Date(730456)
[1] "3969-12-03"
I don't not mind the output format but it needs to be right.
Many thanks
Ed
2006 Jun 19
3
can I call user-created functions without source() ?
Hi,
I have to R fairly recently from Matlab, where I have been used to
organising my own custom functions into directories which are adding to
the Matlab search path. This enables me to call them as I would one of
Matlab's built-in functions. I have not found a way of doing the same
thing in R. I have resorted to using source() on symlinks located in the
current directory. Not very
2018 Jan 18
1
Deploying geo-replication to local peer
Hi Kotresh,
Thanks for response!
After taking more tests with this specific geo-replication configuration I realized that
file extended attributes trusted.gfid and trusted.gfid2path.*** are synced as well during geo replication.
I?m concern about attribute trusted.gfid because value of the attribute has to be unique for glusterfs cluster.
But this is not a case in my tests. File on
2005 Oct 13
3
Help with Matrix package
Hello all,
A colleague at work set me the challenge to convert some MATLAB
code into R, to see which is faster. We'd seen that benchmark comparing
MATLAB 6.5 to R1.90 (and others), and so I thought that I should be able
to get roughly comparable speeds. The code has lots of multiplications
of matrixes, transposes, and MATLAB's "repmat". I did the code
conversion, and R was about
2011 Jan 28
3
any similiar R fuction for matlab function 'fprintf'?
Dear All,
Currently, I am translating Matlab code to R. I met difficulties to translate such Matlab codes into R:
fprintf(fid,(' SPLITTING RESULTS '));
fprintf(fid,(' \n'));
fprintf(fid,' Data base to analyze is a matrix %4i x %2i ',[n m]);
fprintf(fid,' \n');
fprintf(fid,' h is %2i',h);
fprintf(fid,' \n');
fprintf(fid,' group=0
2007 May 15
3
qr.solve and lm
Dear R experts,
I have a Matlab code which I am translating to R in order to examine and
enhance it.
First of all, I need to reproduce in R the results which were already
obtained in Matlab (to make sure that everything is correct).
There are some matrix manipulations and '\' operation among them in the
code.
I have the following data frame
> ABS.df
Pro syn