similar to: Collapse an array

Displaying 20 results from an estimated 10000 matches similar to: "Collapse an array"

2004 Sep 22
3
loops: pasting indexes in variables names
I cannot figure out how, using R, I can paste indexes or characters to the variable names which are used within loops. I will explain this with a simple example: Immagine I have a huge series of variables, each one taken two times, say x1 x2 y1 y2 z1 z2..... Now, immagine that I want to compute a variable from the difference of each couple, say dx=x1-x2, dy=y1-y2, dz=z1-z2... In Stata, for
2005 Jun 07
1
Variables values on intersected intervals
Dear R-list, i have a problem, in the framework of simulations, i want to vectorize for earning time: a variable, say X, has values on intervals and an other variable, say Y, has values on other intervals. For example Inf Sup X 0 2 1 2 4 2 4 6 3 and Inf Sup Y 1 3 1 3 5 2 5 7 3 i want to create a matrix like this Inf Sup
2008 Dec 16
0
[LLVMdev] Another compiler shootout
On Tuesday 16 December 2008 01:03:36 Evan Cheng wrote: > FYI. http://leonardo-m.livejournal.com/73732.html > > If anyone is motivated, please file bugs for the losing cases. Also, > it might make sense to incorporate the tests into our nightly tester > test suite. FWIW, I just ported my ray tracer benchmark to C and found that llvm-gcc gives much worse performance than gcc on x86
2011 Aug 12
1
deSolve output
Hi, I've solved a simple differential equation describing the degradation of amino acid carbon (THAA-C) using deSolve. Code is a follows: # Input of model parameters, a and b describes form of curve, i is apparent initial age of Org. C. parameters <- c(a = a, b = b, i=i) # Initial value of the model, G state = c(G = G) #specifies the function degradation as a function of
2005 Dec 08
1
kronecker(... , make.dimnames=TRUE)
Hi I'm using kronecker() with a matrix and a vector. I'm interested in the column names that kronecker() returns: > a <- matrix(1:9,3,3) > rownames(a) <- letters[1:3] > colnames(a) <- LETTERS[1:3] > b <- c(x=1,y=2) > kronecker(a,b,make.dimnames=TRUE) A: B: C: a:x 1 4 7 a:y 2 8 14 b:x 2 5 8 b:y 4 10 16 c:x 3 6 9 c:y 6 12 18 > The
2008 Mar 05
0
[PATCH] ioemu: fix SDL mouse events processing
ioemu: fix SDL mouse events processing - GetRelativeMouseState always returns the last position, so when the polling loop gets several mouse events in one go, we would send useless ''no move'' events. - So as to make sure we don''t miss any mouse click / double click, we should not use GetRelativeMouseState() to get the button state, but keep records of the button
2007 Oct 17
3
Trouble with R CMD INSTALL
Why does R CMD INSTALL work for some packages (e.g., lme4) but not others (e.g., nlme)? Thanks, Gang
2006 Jun 28
3
Problem with package sem
Hi experts, I just started to learn R today, and tried to work with an add-on package sem. I have a version of 2.3.1 on MacOS X 10.4.6 with sem put under /Library/Frameworks/R.framework/Versions/2.3/Resources/library However when I typed library(sem) the following error showed up: Error in library(sem) : 'sem' is not a valid package -- installed < 2.0.0? Why is this? Thank
2011 Dec 10
2
efficiently finding the integrals of a sequence of functions
Hi folks, I am having a question about efficiently finding the integrals of a list of functions. To be specific, here is a simple example showing my question. Suppose we have a function f defined by f<-function(x,y,z) c(x,y^2,z^3) Thus, f is actually corresponding to three uni-dimensional functions f_1(x)=x, f_2(y)=y^2 and f_3(z)=z^3. What I am looking for are the integrals of these three
2007 Dec 06
2
Any package for deconvolution?
I want to run deconvolution of a time series by an impulse or point-spread function through Wiener filter, regularized filter, Lucy-Richardson method, or any other approaches. I searched the CRAN website and the mailing list archive, but could not find any package for such a deconvolution analysis. Does anybody know an existing R function for deconvolution? TIA, Gang
2007 Nov 07
2
Trouble in creating a list
I want to create a list based on the information from a data.frame, Model. So I tried the following: MyList <- list(colnames(Model)[2] = levels(Model$(colnames(Model)[2]))) but it failed with an error: Error: unexpected '=' in "list(colnames(Model)[2] =" I have the following problems with this command line: (1) I wanted to use colnames(Model)[2] as a tag for the list:
2008 Dec 16
6
[LLVMdev] Another compiler shootout
FYI. http://leonardo-m.livejournal.com/73732.html If anyone is motivated, please file bugs for the losing cases. Also, it might make sense to incorporate the tests into our nightly tester test suite. Thanks, Evan
2008 Apr 11
2
How to fill out some columns?
Dear R users, I'm working with 2 data sets which look like (for example) dx and dy in the next code: # Seed set.seed(4) # First data frame dx=matrix(rnorm(6*5),ncol=6) colnames(dx)=LETTERS[1:6] # Second data frame dy=matrix(rnorm(3*5),ncol=3) colnames(dy)=c('A','C','E') As you will notice, some columns in both data sets have the same names. At the end, what I need
2011 Aug 11
1
Splitting data
I want to implement the following algorithm in R: I want to split my data, use a t test to compare both means of the groups to see if they significantly differ from each other. If this is a yes (p < alpha) I want to split again (into 4 groups) and do the same procedure twice, and stop otherwise (here the problem arises). As a final result I would have different groups of data. I made some
2008 Jan 17
2
Trouble receiving messages from the mailing list
For some unknown reason I stopped receiving any messages from the R- help mailing list. See if this test gets through. Thanks, Gang
2002 Mar 21
1
legend - bug with argument angle (PR#1404)
When legend() is used with the angle argument as follows, not only the boxes beside the legend text, but also the whole legend box is filled with shading lines. I think this is not intended: plot(1:10) legend(8, 4, c("A", "B"), angle=c(10, 80), fill=NULL, density=20) I'd suggest as a fix (legend.R of R-1.5.0): 25c25 < rect2 <- function(left, top, dx, dy,
2012 Oct 10
3
Generating random geographical coordinates
Dear all, I have two coordinates vectors, say X and Y of length n. I want to generate for each couple of coordinates X1,Y1 X2,Y2 X3,Y3....Xn,Yn a random coordinate which is located in a square define as X +/- dx and Y +/- dy. I saw the runif function which can generate for just one value at a time what I want : runif(1, X - dx, X + dx) for X and runif(1, Y - dy, Y + dy) for Y. I would like
2012 Nov 27
2
in par(mfrow=c(1, 2)), how to keep one half plot static and the other half changing
Hi, I'm trying to plot something in the following way and would like if you could help: I'd like in a same plot window, two plots are shown, the left one is a bird-view plot of the whole data, the right half keep changing, i.e., different plots will be shown up on request, so that when I select/click on some where in the left plot, the right plot will be the corresponding plot. What I
2012 Jul 29
1
Return od functions
Hi! I have some questions about R function. I try to write a function for multi-returns. The function code is as attachment. dgp.par<-function(ai, bi, t, n) { t0<-t+20 y0<-matrix(0, nr=t0, nc=n) y0[1,]<-ai/(1-bi) for(tt in 2:t0) { y0[tt,]<-ai+bi*y0[tt-1,]+rnorm(n, 0, 1) } y<-y0[21:t0,] x<-y0[20:t0-1,] z<-y0[19:t0-2,] z<-z[2:t,] dy<-y[2:t,]-y[1:t-1,]
2010 Jul 19
5
par("uin") ?
I inherited a function written either for an older version of R or SPlus to draw a brace, "{", in a graph. It uses par("uin") to determine the scaling of the quarter circles that make up segments of the brace, but that setting doesn't exist in current R. I'm guessing that, in the function below, ux, uy can be defined from par("usr") and