similar to: Extracting from a matrix w/o for-loop

Displaying 20 results from an estimated 4000 matches similar to: "Extracting from a matrix w/o for-loop"

2005 May 15
1
Save parameters from optim during iteration procedure
Dear R-users, I am going to try to be as clearer as possible, showing also an example. 1) I have a function (in my real case it's much more complex) 2) I use "optim" to minimize 3) I want to use as method L-BFGS-B for several reasons 4) I know I could use "trace=6" (in "control") in order to see "live" the procedure 5) I would like to see separately the
2006 May 16
1
optim with specific constraints on possible values
Dear R-users, I am working with some grid-search optimization for 13 values of an object function. At glance one may compute the object function for each possible combination of set of parameters, but in my case would not be feasible: taking for example 13 possible values for each parameters like, in logarithm scale, 10^seq(-3,3,.5) will lead to 13^13 combinations of results. As a second trial
2009 Apr 08
1
persp3d and rgl.viewpoint for rotating 3D plots
Dear R-users, within the rgl-package, I would have a question about the usage of persp3d in combination of rgl.viewpoint. I am not able to figure out how to let a 3D plot rotating around likewise the example in ?rgl.viewpoint. It seems that when I use persp3d(...) I see something on my screen, which is different from what I get when it's rotating. Is there any different behavior between
2009 Mar 19
1
two plots side-by-side with persp3d(rgl)
Dear R-users, I would like to place two 3D plots side-by-side in a rgl-setting. It would nice to have something like "par(mfrow=c(1,2))" for basic plots, or an array framework for wireframe(lattice) (see example below). I only managed to overlap two persp3d plots. My final idea would be to animate both surfaces using play3d(rgl). Thanks in advance for any help. Best, Carlo Giovanni
2006 May 09
2
draw a graphic using segments to represent data
Hello, I'd like to draw a graphic using different color line segments to represent microarray data. It simply likes this: Data=cbind(c(1, 2, -1, 3, -2.2), c(1, 3, -1, -1.8, 4)) The first col No represents y'axis position (negative down and positive up). The second col No represents a length of segment (negative segment should be on left of y, and positive on right). Also the
2006 Apr 28
2
How to get a grid behind a boxplot
I am using R 2.2.1 on a Windows 2000 PC. When I do a grid() after the boxplot it overprints the boxplot: > boxplot(count ~ spray, data = InsectSprays, col = "lightgray") > grid(nx=NA, ny=NULL) > if I try the panel.first > boxplot(count ~ spray, data = InsectSprays, col = "lightgray", + panel.first=grid(nx=NA, ny=NULL)) > I can see the grid flash
2006 Nov 07
2
wrong fill colors in polygon-map
Dear all, I would like to produce a map with information about the patenting activity in German districts, by coloring districts with different degrees of patenting activity in different colors. I work with the packages maptools, maps and spdep. The map data is read from an external .shp file (+ the corresponding .shx and .dbf files). Plotting a map with the IDs or the patenting indicator itself
2006 Jan 30
3
Subsetting a matrix without for-loop
Dear R-users, I'm struggling in R in order to "squeeze" a matrix without using a for-loop. Although my case is a bit more complex, the following example should help you to understand what I would like to do, but without the slow for-loop. Thanks in advance, Carlo Giovanni Camarda A <- matrix(1:54, ncol=6) # my original matrix A.new <- matrix(nrow=3, ncol=6) # a new
2017 Mar 03
2
Bug in nlm()
Dear all, I have found a bug in nlm() and would like to submit a report on this. Since nlm() is in the stats-package, which is maintained by the R Core team, bug reports should be submitted to R's Bugzilla. However, I'm not a member of Bugzilla. Could anyone be so kind to add me to R's Bugzilla members or let me know to whom I should send the bug report? Thank you in advance. Kind
2004 Aug 30
3
Generalized Singular Value Decomposition (GSVD)
Dear R-users, I couldn't find a function or some help in R-project web about the Generalized Singular Value Decomposition. In MatLab there is a simple function for this algebric issue (gsvd). Is there anything like that in R? And, if not, could you help me to apply this method in R? Thanks in advance, Giancarlo +++++ This mail has been sent through the MPI for Demographic Rese...{{dropped}}
2013 Apr 19
3
extracting the diagonal of an inverse matrix
Dear R-users, I would like to know whether there is a way to extract a diagonal of an inverse matrix without computing the inverse of the matrix itself. The size of my matrices are really huge and, also using sparse matrix, computing the inverse leads to storage problems and low speed. In other words, given a square matrix A, I aim to know diag(B), where B=solve(A), without computing solve(A).
2004 Jul 30
1
optimisation procedure with flat log-likelihood
Dear R-friends, I use optim(par=c(mystartingpoints), fn=myloglikelihoodfunction, gr=NULL, method=c("L-BFGS-B"), ## I would like to do not use any bounds control=list(trace=6, ## just to see what it's going on maxit=c(20000)), ## to be sure the it doesn't stop reaching the max iterations
2005 Oct 12
1
Historical England and Wales Shape Files
Dear R-user, I would like to apply spatial statistics on some historical data, in particular from 1850 to 1900 by registration district of England and Wales. I have searched in the R-archive, but unsuccessfully. Do you know whether R contains those shape files? Or where would be possible to download and use in R? Thanks in advance, Carlo Giovanni Camarda +++++ This mail has been sent through the
2010 Sep 29
1
generalized additive mixed models for ordinal data
? stato filtrato un testo allegato il cui set di caratteri non era indicato... Nome: non disponibile URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100929/bedab79b/attachment.pl>
2005 Oct 18
1
Solid and dotted lines saving an xyplot
Dear R-users, I would a small problem saving a graph with postscript after using xyplot. Whereas in the R-screen the two lines are solid, once the image is saved as .eps file the second lines (blue in the following example) is dotted. Here there is a simple example. Thanks in advance for your help, Carlo Giovanni Camarda # creating data a1 <- sort(runif(10)) a2 <- sort(runif(10)) a3 <-
2005 Jan 21
6
Avoiding a Loop?
Dear R-Helpers, I have a matrix where the first column is known. The second column is the result of multiplying this first column with a constant "const". The third column is the result of multiplying the second column with "const"..... So far, I did it like this (as a simplified example): nr.of.columns <- 4 myconstant <- 27.5 mymatrix <- matrix(numeric(0), nrow=5,
2005 Jun 14
2
Plotting rows (or columns) from a matrix in different graphs, not using "par"
Dear R-users, I would like to ask whether it's possible (for sure it would be), to plot each rows (or columns) in different graphs and in the same figure region without using the function "par" and then struggling around with "axes" and labels etc. Luckily, I would always have "rows + columns = even number" and the same "ylim". The next one could be a
2005 Aug 17
2
power of a matrix
Dear all, I have a population with three age-classes, at time t=0 the population is: n.zero <- c(1,0,0) I have a transition matrix A which denotes "fertility" and "survival": A <- matrix(c(0,1,5, 0.3,0,0, 0,0.5,0), ncol=3, byrow=TRUE) To obtain the population at t=1, I calculate: A %*% n.zero To obtain the population t=2, I calculate: A %*% (A %*% n.zero) ... and so
2004 Aug 10
1
persp, array and colors
Dear R-users, I'd like to plot a three-dimensional surface and at the meantime I'm using an array. I would like to have the values of my first matrix in the heights of the plot and the colors of the single facet taking into account the second matrix. I hope that the next code will help all of you to understand better my issue, Thanks in advance, Giancarlo ############################ ##
2006 Feb 01
1
glm-logistic on discrete-time methods with individual and aggregated data
Dear R-Users, without going into details I tried to prepare a simple example to show you where I would need help. In particular I prepare two examples-template for a study I'm conduction on discrete-time methods for survival analysis. Each of this example has two datasets which are basically equal, with the exception that in the former one has individual data and in the latter one aggregated