similar to: array manipulation

Displaying 20 results from an estimated 100 matches similar to: "array manipulation"

2011 Nov 17
2
function sum for array
I'm looking for a function that allows to sum the elements of an array along a dimension that can be different from the classical ones (rows or columns). Let's suppose for example that: - A is an array with dimensions 2 x 3 x 4 - I want to compute B, a 2 x 3 matrix with elements equal to the sum of the corrensponding elements on each of the 3 strata. I've tried to use
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
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 <-
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
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
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)
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
2003 Feb 06
6
Confused by SVD and Eigenvector Decomposition in PCA
Hey, All In principal component analysis (PCA), we want to know how many percentage the first principal component explain the total variances among the data. Assume the data matrix X is zero-meaned, and I used the following procedures: C = covriance(X) %% calculate the covariance matrix; [EVector,EValues]=eig(C) %% L = diag(EValues) %%L is a column vector with eigenvalues as the elements percent
2007 Nov 19
1
Changing TBF rate on the fly results in drops?
Hi everybody, it is my first message here. I tried to browse throughout older posts but I found no immediate answer. I need to change rate of a tbf queue while ip packets are already enqueued by it. If I go: tc qdisc replace|change|link dev eth0 root tbf rate 180kbit burst 1540 limit 15400 as results all enqueued packets seems to disappear. I can see that from a: tc -s qdisc ls dev eth0
1998 Nov 24
1
printers.def
Hello ! I am sure this has been posted before but I can not find it. I have used a file to check witch files a .inf file shall use. This util was very good to have when making a printers.def file. My problem is that I can not find the file anymore and I do not know the name of it. Thanks, /Mikael
2019 May 29
4
[PATCH 0/3] Simple augeas-related changes
- bump the augeas requirement to 1.2.0, and drop an old hack - add a small helper in the generator Pino Toscano (3): build: raise augeas requirement to 1.2.0 appliance: remove custom Shadow augeas lens daemon: implement OptString for OCaml APIs appliance/Makefile.am | 6 +-- appliance/guestfs_shadow.aug | 72 ------------------------------------ daemon/augeas.c | 21
2001 Jul 10
0
speeding up aperm/ adding repmat
Hi, I have noticed that aperm is very slow, and I wondered if there was a way of speeding it up. Let me tell you a bit about the context of my problem, because perhaps I shouldn't be using aperm at all. The context is probabilistic inference in graphical models. One of the most fundamental operations is two compute an element-wise multiplication of two arrays of different sizes, say A and B.
2014 Oct 24
1
[PATCH v3] daemon: Remove custom Augeas lenses.
v3: - Don't remove the LVM transform.
2014 Oct 24
1
[PATCH v2] daemon: Remove custom Augeas lenses.
v2 of previous patch, which fixes some missing bits. For now I'm going to go with Pino's RHEL 7.1 patch, since it is at least smaller than this. So I'm sending this to the list just to have it archived for later. Rich.
2014 Sep 04
10
[PATCH 0/5] use augeas for /etc/shadow
Hi, currently /etc/shadow is edited manually when needed (i.e. when setting the password for an user), and it is not changed when removing users. Import the upstream shadow.aug (currently in their development serie, but not part of any released version yet), and use it only when the augeas version is less than a potential 1.2.1 (covering also the case when the new version is just 1.3.0). Pino
2012 May 10
1
envfit output (vegan package) - not sure what it means
I'm pretty new to R and would appreciate some help interpreting the output of a function that was recommended to me. I've used the *envfit *function in the vegan package to plot vectors of four climate variables onto a species matrix ordination. The output indicates that only a single variable (mean_temp) is significant: ***VECTORS NMDS1 NMDS2 r2
2013 Jan 08
1
GLMM post- hoc comparisons
Hi All, I have data about seed predation (SP) in fruits of three differents colors (yellow, motted, dark) and in two fruiting seasons (2007, 2008). I performed a GLMM (lmer function, lme4 package) and the outcome showed that the interaction term (color:season) was significant, and some combinations of this interaction have significant Pr(>|z|), but I don't think they are the right
2016 Nov 10
5
[PATCH v5 0/3] v2v and augeas
Augeas 1.7.0 was released a couple of days ago. By encouraging everyone to upgrade to this we can drop several calls to aug_transform and also our custom copies of two lenses, and a lot of related code. Rich.
2005 Mar 05
4
How to use "lag"?
Is it possible to fit a lagged regression, "y[t]=b0+b1*x[t-1]+e", using the function "lag"? If so, how? If not, of what use is the function "lag"? I get the same answer from y~x as y~lag(x), whether using lm or arima. I found it using y~c(NA, x[-length(x)])). Consider the following: > set.seed(1) > x <- rep(c(rep(0, 4), 9), len=9) > y <-