Displaying 20 results from an estimated 500 matches similar to: "looking for equivalent of matlab's medfilt1 function"
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
2006 May 29
2
Analog to matlab repmat function
Hello,
I'm trying to switch from Matlab to R-project, and having some difficulties.
I make a use of multidimensional matrices. For example, I need to extract
mean from one of the dimensions:
% we have matrix data of size: 130 x 11 x 350 x 2
data = data - repmat(mean(data,3),[130 1 1 1]);
In R project I managed to do that in a very pervarsive way:
# mean(data,3) in R
base <-
2004 Sep 28
2
S4 method selection based on second argument
I'm translating some Matlab code and need some help figuring
out how to change this call into an S4 generic method.
In matlab, there's a function called 'repmat' with three
calling sequences (all I have to deal with anyway):
1) B = repmat(A, m, n)
2) B = repmat(A, [m n])
3) B = repmat(A, n)
In all cases, A is the fill value, m is number of rows,
and n is number of
2002 Jan 03
6
Graphical representation of a matrix ?
Hi,
The function Repmat under S allows to represent a matrix of data.
Is there an equivalent function under R ?
thanks for your reply
Bruno
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not
2013 Mar 05
1
boxplot with frequencies(counts)
Dear All,
I have a table as following
position type count
1 2 100
1 3 51
1 5 64
1 8 81
1 6 32
2 2 41
2 3 85
and so on
Normally if would have a vector of 2,3,4,5... by position position and
plot them by position.
But now i have counts of these types.
Is there a way to compute boxplot of such
2009 Feb 05
2
Non-linear optimisation
Hi there,
I have a piece of Matlab code I use to optimise a trding strategy. If there
are any Matlab/R specialists out there, I would appreciate your help in
doing the exact same optimisation in R.
I suspect I would use nlm() in R but am not sure where to define my
constraints.
I have attached my Matlab code below for reference.
Many thanks.
Constraints
function [c,ceq]=TriskellConstraints(X)
2011 Nov 02
4
array manipulation
Hello,
I'm at the very beginning of the learning process of this language.
Sorry in advance for the (possible but plausible) stupidity of my question.
I would like to find a way to permute the DIMENSIONS of an array.
Something that sounds like the function "permute()" in matlab.
Given an array C of dimensions c x d x T , for instance, the command
permute(C, [2 1 3])
would provide
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
2005 Jun 24
3
Counterpart for Matlab's 'feval'?
Hi!
I've just begun writing a program that searches for the minimum of a
function with golden section search. In order to do this in a nice way I
need a function that takes a function name and an argument and returns the
function value for that argument, i .e just like Matlab's 'feval'. Is
there any?
Thanks before hand!
Best regards,
Fredrik Thuring, Codan Insurance A/S
2009 Mar 10
2
R equivalent to MATLAB's "whos" Command?
By any chance is there an R equivalent to MATLAB's "whos" command?
I tried searching R and R-seek, but didn't really come up with anything.
There are several items I would like to make sure are stored in the workspace and check their values.
Thank you again for your help and any feedback.
> ?workspace
No documentation for 'workspace' in specified
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
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
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
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
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]]
2007 Aug 15
4
Possible to "import" histograms in R?
Hi,
I have a large amount of data that I would like to create a histogram of and
plot and do things with in R. It is pretty much impossible to read the data
into R, so I have written a program to bin the data and now have a list of
counts in each bin. Is it possible to somehow import this into R and use
hist(), so I can, for instance, plot the probability density? I have looked
at the help page
2007 Oct 16
3
Updating R-Software without complete new installation
Hallo,
as I see there is a new version for R available. Can anyone tell me how
I can update my version 2.5.0 under Windows? The last times I just
uninstalled the old version and installed the new one. Afterwards I had
to install also all needed packages again. All in all it cost me half a
day until my system works fine again. Is there a quicker option? If yes
please tell me the commands.
Thanks,
2007 Apr 26
3
adding a column to a matrix
i would like to add a variable to an existing matrix by manipulating 2 previous variables eg for the data
m
treat strata censti survTime
[1,] 1 2 284.684074 690.4961005
[2,] 1 1 172.764515 32.3990335
[3,] 1 1 2393.195400 24.6145279
[4,] 2 1 30.364771 8.0272267
[5,] 1 1 523.182282 554.7659501
l
2004 Oct 07
8
Equivalents of Matlab's 'find' and 'end'
Sorry if these questions have been asked recently--I'm new to this list.
I'm primarily a Matlab user who is attempting to learn R and I'm searching for possible equivalents of commands that I found very handy in Matlab. So that I don't seem ungrateful to those who may answer, I HAVE determined ways to carry out these processes in 'brute force' sorts of ways in R code,
2007 Feb 04
1
Fwd: Re: Calling C code from R
Hi!
Thanks in advance.
Thanks to all of you who have responded to me on above. This is one of the responses I received on above.
I have installed perl (with path C:\Perl\bin\;) an MinGW (with path C:\MinGW\bin; C:\MinGW;).
At the Command Prompt (C:\R-2.4.0\bin) I have typed:
C:\R-2.4.0\bin>Rcmd SHLIB useC1.c
(No error and useC1.dll file has not been created)