similar to: Sorting a matrix in an odd way

Displaying 20 results from an estimated 7000 matches similar to: "Sorting a matrix in an odd way"

2007 Apr 11
1
Programming Problem (for loop, random # control, 3 dimentional graph)
Dear List, This is just a programming problem which i cannot seem to figure out. I am trying to get a set of power from a test (say, kolmogorov smirnov) out of a distribution (say, G-K distribution) as follows. I am trying to reduce to pain of writing the whole set of data points (p# below) using "for" loop. However, I seem to have some problem in it as the output "M" does not
2009 Sep 21
2
Four concurrent Markov chains
Hi, I am trying to write a simulation of the movements of four animals between six patches. The movement between patches is based on a first-order Markov chain so that the next patch they visit depends on the patch they were in before. I have written code that allows me to simulate the movement of one animal but when I add more there seems to be a problem and all chains come back as N/A. I can
2002 May 18
3
checkerboard plot?
Hi, I've been doing a lot of CA modeling lately and am now wanting to make some checkerboard plots in R. Let's say I have a matrix: > is.matrix(junk) [1] TRUE > junk [,1] [,2] [,3] [,4] [,5] [1,] 0 0 1 0 0 [2,] 0 1 1 1 0 [3,] 0 1 0 0 1 [4,] 0 1 1 1 1 [5,] 0 1 0 0 0 > and I want to make a
2010 Jun 30
2
plain text in Chinese can not be set
Hi there, According to ?par, 'font' is an integer which specifies which font to use for text, that 1 corresponds to plain text (the default), 2 to bold face, 3 to italic and 4 to bold italic. When I test Chinese character in pdf(), I found that 1 to bold face, 2 to italic, 3 to bold italic, 4 to symbol. and I don't find how to set plain text. In the following code, the font to use
2004 Nov 11
6
scan or source a text file into a list
I've ported somebody else's rather cumbersome Matlab model to R for colleagues that want a free build of the model with the same type of I/O. The Matlab model reads a text file with the initial parameters specified as: C:\Data\Carluc\Rport>more Params.R # Number of years to simulate nYears = 50; # Initial year for graphing purposes year0 = 1970; # NPP/GPP ratio (cpp0 unitless) fnr =
2005 Aug 22
1
cbind and rbind
Hi, I have been trying for a while to use cbind and rbind to add a row and column to the same table but seem to be able only to add one OR the other??? Any help would be most welcome, Tony Evans Australia [[alternative HTML version deleted]]
2005 Apr 20
3
if(foo == TRUE) .. etc
Martin Maechler wrote: > More generally, please, please, everyone : > > Replace > if (something == TRUE) > with if (something) > and > if (something.or.other == FALSE) > with if (!something.or.other) Amen! And right on! And you tell 'em! And a few other exclamations, several of which are not suitable for a family program. That sort of syntax,
2005 Apr 29
2
congratulations to the JGR developers
Just want to offer my congratulations to the JGR developers as the recepient of the 2005 Chambers Award. Great job, guys!! http://stats.math.uni-augsburg.de/JGR/ [Now, could JGR be updated to work with 2.1.0 (or be made R version independent, please... 8-)] Best, Andy
2003 Mar 19
2
Time Series-like barplot?
I have data structured like the following: > foo.mat <- matrix(NA, ncol = 5, nrow = 10) > foo.mat[2:6,1] <- 1 > foo.mat[1:3,2] <- 1 > foo.mat[3:10,3] <- 1 > foo.mat[1:10,4] <- 1 > foo.mat[8:10,5] <- 1 > foo.mat [,1] [,2] [,3] [,4] [,5] [1,] NA 1 NA 1 NA [2,] 1 1 NA 1 NA [3,] 1 1 1 1 NA [4,] 1 NA 1 1
2006 Apr 07
3
finding common elements in a list
Suppose I have a list where I want to extract only the elements that occur in every component. For instance in the list foo I want to know that the numbers 2 and 3 occur in every component. The solution I have seems unnecessarily clunky. TIA, Andy foo <- list(x = 1:10, y=2:11, z=1:3) bar <-unlist(foo) bartab <- table(bar) as.numeric(names(bartab)[bartab==length(foo)])
2007 Aug 18
1
Restricted VAR parameter estimation
I have a VAR model with five macro-economic variables, y[1], y[2], y[3], y[4], y[5]. They are related to each other in following manner. y[1,t] = alpha[1,0] + beta[1,1, 1]*y[1,t-1]+............+beta[1,1, 12]*y[1,t-12] + beta[1,2, 1]*y[2,t-1]+............+beta[1,2, 12]*y[2,t-12] + e[1,t] y[2,t] = alpha[2,0] + beta[2,2, 1]*y[2,t-1]+............+beta[2,2, 12]*y[2,t-12] + e[2,t] y[3,t] = alpha[3,0]
2009 Jul 30
1
ask help about boxplot , different list variation into the tick of x-axis?
Hi ,everyone. I want to draw a boxplot figure, main script shown as below. when I run the command "boxplot(bjavee~yearname)",it is wrong with the error information " model.frame.default(formula = bjavee ~ yearname) : variation 'bjavee' list is wrong". I want to add the yearname as the x-axis tick. And yearname is a array with the length 12,while bjavee is a 5*12
2010 Jul 03
2
logistic regression - glm() - example in Dalgaard's book ISwR
Dear R-list members, I would like to pose a question about the use and results of the glm() function for logistic regression calculations. The question is based on an example provided on p. 229 in P. Dalgaard, Introductory Statistics with R, 2nd. edition, Springer, 2008. By means of this example, I was trying to practice the different ways of entering data in glm(). In his book, Dalgaard
2005 Oct 16
4
Cannot telnet to port 5038 on asterisk
Hi, I cannot do the following: telnet 127.0.0.1 5038 I get connection refused and this is preventing AMP from installing. I had this working when I was using FC3 but I had to upgrade to FC4 for another application. So I am running PHP5, MYSQL 4 with FC4 and asterisk is running (I had this problem before with FC3 and it turned out asterisk was not running) I am using 1.2.0 beta1 Asterisk
2005 Nov 10
2
ltext - adding text to each panel from a matrix
Hi all (really probably just Deepayan): In the plot below I want to add text on either side of each violin plot that indicates the number of observations that are either positive or negative. I'm trying to do this with ltext() and I've also monkeyed about with panel.text(). The code below is generally what I want but my calls to ltext() are wrong and I'm not sure how to fix them.
2010 Jun 15
2
Integration problem: error in invoking an outside function
Dear all, Currently I am trying to integrate a function which depends on four variables, two of which are given, one is given in the integrate function, so there is one variable to integrate on. The code is as follows: Pmatrix = function(th) { P = matrix(nrow=6, ncol=6, data=0) P[1,1] = P[2,1]=P[3,2]=P[4,3]=P[5,4]=P[6,5]= exp(-th) P[,6] = 1-exp(-th) return(P)} lim.verd =
2004 Feb 17
4
importing ascii grids (for gstat)
Hello, Is there anyone who could give me an example of how to import an ascii grid (i.e. ArcGIS exported raster) into R. I want to use it with gstat but don't know the appropriate import routine. Thanks very much for your help. Regards, femke Femke Reitsma Graduate Student (ABD) Geography Department 2181 LeFrak Hall University of Maryland College Park, MD 20742 Phone: 301-405-4121
2004 Aug 24
2
call queue help
Guys I am having some serious issues with my call queue and Management is breathing down my neck pretty bad, and I am running out of ideas. I have a single queue for my tech support department. I originally was using the AgentCallbackLogin for them and it tested out great on our testing weekends, but it hasn't worked out since. It would only let one of them take calls at a time, no matter
2003 Aug 26
1
Getting out of an embedded function safely - use try?
Helpers. An instrument sends me data that is mostly nonlinear. I have a group of functions to manipulate this data so that it is useful to the user. One of them involves a nls model that called to fit a line to the data and returns the fits. This works well 99 out of 100 times. Occasionally, the sensor sends some bad data to which a nls model cannot be fit. When that happens, the nls function
2006 Mar 10
1
add trend line to each group of data in: xyplot(y1+y2 ~ x | grp...
Although this should be trivial, I'm having a spot of trouble. I want to make a lattice plot of the format y1+y2 ~ x | grp but then fit a lm to each y variable and add an abline of those models in different colors. If the xyplot followed y~x|grp I would write a panel function as below, but I'm unsure of how to do that with y1 and y2 without reshaping the data before hand. Thoughts