similar to: Specifying the ordering of a vector

Displaying 20 results from an estimated 30000 matches similar to: "Specifying the ordering of a vector"

2009 Apr 28
2
effects package --- add abline to plot
Hello, I am not having success in a simple task. Using the effects package, I would like to add reference lines at probability values of 0.1 – 0.6 on a plot of the effects. The plot command works, but following up with an abline command produces the message “plot .new has not been called yet”, and of course the reference lines were not added. Looking through past R help lists, there was a
2007 Mar 07
1
Failure to run mcsamp() in package arm
Dear r-helpers, I can run the examples on the mcsamp help page. For example: **************************************** > M1 <- lmer (y1 ~ x + (1|group)) > (M1.sim <- mcsamp (M1)) fit using lmer, 3 chains, each with 1000 iterations (first 500 discarded) n.sims = 1500 iterations saved mean sd 2.5% 25% 50% 75% 97.5% Rhat n.eff beta.(Intercept)
2013 Mar 07
1
create vector from indices interpolated values
Readers, Is it possible to create a plot command based upon the indices of missing values in a data set? dataset1<-read.table(text=' 10 2 20 NA 30 5 40 7 50 NA 60 NA 70 2 80 6 90 NA 100 9 ') dataset2<-read.table(text=' 0.2 0.4 0.1 0.9 0.2 0.3 1.1 0.7 0.9 0.6 0.4 ') The 'approx' function is used to obtain the interpolated values for 'NA' in dataset1.
2008 Nov 14
1
Generating unique permutations of a vector
Hi all, I try to generate sets of strategies that contain probability distributions for a defined number of elements, e.g. imagine an animal that can produce 5 different types of offspring and I want to figure out which percentage of each type it should produce in order to maximize its fitness. In order to do so, I need to calculate the fitness for all potential strategies. As an example, if I
2005 Dec 03
1
Correlation matrix from a vector of pairwise correlations
I've a vector of pairwise correlations in the order low-index element precedes the high-index element, say: corr(1,2)=0.1, corr(1,3)=0.2, corr(2,3)=0.3, corr(3,4)=0.4 How can I construct the corresponding correlation matrix? I tried using the "combn"-function in "combinat" package: library(combinat) combn(c(0.1,0.2,0.3,0.4),2) , but to no avail... Thank you for your
2012 Jul 06
3
estimating NA values against selected slots
Dear R Users, Could you please help me on the following issue? I have a real large yearly data set. For each year I have 365 flow values. Some of the flow values are not known and that’s why you will see NA written in those slots. I wanted to know, is there a way that I can estimate those values? I tried approx command but it seems least helpful for the kind of issue I am up against.
2010 Aug 16
1
Specify decimal places for parameters in BUGS output
Hi All: I had a basic question to ask. I am running R2WinBUGS so that I could automate the running of my model using 1000 simulated datasets. Below is the code I am using. The only problem I am having is the bugs output that comes out shows my parameters as nos with 1 decimal place after. I would want to have the parameters with 5 places after decimal. How would I specify that in my code for
2012 Jul 10
2
estimation of NA by predict command
Dear arun and all R users, I will first of all try to simply define my issue.. I have data in the following format Year Discharge dd/mm/yyyy x .. … … … There are some NA values in the discharge which I would like to predict by using “predict command”. I cant figure out the way to write the coding for that. Could you please help me on that??? I have also ,written
2007 Oct 22
2
Help interpreting output of Rprof
Hello there, I am not quite sure how to interpret the output of Rprof (in the following the output I was staring at). I was poking around the web a little bit for documentation but without much success. I guess if I want to figure out what takes so long in my code the 2nd table $by.total and the total.pct column (pct = percent) is the most helpful. What does it mean that [ or [.data.frame is
2006 Jun 25
1
Puzzled with contour()
Folks, The contour() function wants x and y to be in increasing order. I have a situation where I have a grid in x and y, and associated z values, which looks like this: x y z [1,] 0.00 20 1.000 [2,] 0.00 30 1.000 [3,] 0.00 40 1.000 [4,] 0.00 50 1.000 [5,] 0.00 60 1.000 [6,] 0.00 70 1.000 [7,] 0.00 80 0.000 [8,] 0.00 90
2009 Oct 19
2
how to get rid of 2 for-loops and optimize runtime
Short: get rid of the loops I use and optimize runtime Dear all, I want to calculate for each row the amount of the month ago. I use a matrix with 2100 rows and 22 colums (which is still a very small matrix. nrows of other matrixes can easily be more then 100000) Table before Year month quarter yearmonth Service ... Amount 2009 9 Q3 092009 A ...
2011 Nov 15
5
Convert back to lower triangular matrix
Given a vector;> ab = seq(0.5,1, by=0.1)> ab[1] 0.5 0.6 0.7 0.8 0.9 1.0 The euclidean distance between the vector elements is given by the lower triangular matrix > dd1 = dist(ab,"euclidean")> dd1    1   2   3   4   52 0.1                3 0.2 0.1            4 0.3 0.2 0.1        5 0.4 0.3 0.2 0.1    6 0.5 0.4 0.3 0.2 0.1 Convert the lower triangular matrix to a full
2010 Oct 20
3
combine vectors in an alternating way
I have two vectors min 0.2, 0.3, 0.6, 0.1 max 0.4,0.5,0.7,0.4 Is there a way to combine these two vector so that the values will be taken from the vectors alternating so that I will get a new minmaxminmaxminmax-vector? minmax 0.2,0.4,0.3,0.5,0.6,0.7,0.1,0.4 Any help is much appreciated -- View this message in context:
2010 Dec 22
3
How to integrate a function with additional argument being a vector or matrix?
Dear expeRts, I somehow don't see why the following does not work: integrand <- function(x, vec, mat, val) 1 # dummy return value A <- matrix(runif(16), ncol = 4) u <- c(0.4, 0.1, 0.2, 0.3) integrand(0.3, u, A, 4) integrate(integrand, lower = 0, upper = 1, vec = u, mat = A, val = 4) I would like to integrate a function ("integrand") which gets an "x" value (the
2011 Nov 15
1
Convert full matrix back to lower triangular matrix
Given a vector;> ab = seq(0.5,1, by=0.1)> ab[1] 0.5 0.6 0.7 0.8 0.9 1.0 The euclidean distance between the vector elements is given by the lower triangular matrix > dd1 = dist(ab,"euclidean")> dd1    1   2   3   4   52 0.1                3 0.2 0.1            4 0.3 0.2 0.1        5 0.4 0.3 0.2 0.1    6 0.5 0.4 0.3 0.2 0.1 Convert the lower triangular matrix to a full
2007 Nov 07
1
Aggregate with non-scalar function
R-Helpers, I'm sorry to have to ask this -- I've not used R very much in the last 8 or 10 months, and I've gotten rusty. I have the following (ff2 is a subset of a much, much larger dataset): > ff2 hostName user sys idle obsTime 10142 fred 0.4 0.5 98.0 2007-11-01 02:02:18 16886 barney 0.5 0.2 94.6 2007-10-25 19:12:12 8795 fred 0.0 0.1 99.8
2009 Dec 03
2
Help R2WinBUGS
Hello, I have problem running WinBUGS from R. The following example works in WinBUGS but it does not work in R through package R2WinBUGS. Does anyone know what the problem is? x <- c(0.2, 1.1, 1, 2.2, 2.5, 2.9, 2.9, 3.6, 3.8, 0.6, 1, 2, 2.4, 2.6, 2.8, 3.2, 3.9, 3.5) y <- c(0.5, 1.3, 0.1, 0.7, -0.4, 0.5, -0.9, -0.3, -0.3, 0.6, 0.4, 0.9, -0.1, -0.4, -0.5, -0.2, 0.3, -1.5) eco <- c(1, 3,
2011 Apr 09
5
Yearly aggregates and matrices
Hi, I need to perform calculations on subsets of a data frame: DF = data.frame(read.table(textConnection(" A B C D E F 1 a 1995 0 4 1 2 a 1997 1 1 3 3 b 1995 3 7 0 4 b 1996 1 2 3 5 b 1997 1 2 3 6 b 1998 6 0 0 7 b 1999 3 7 0 8 c 1997 1 2 3 9 c 1998 1 2 3 10 c 1999 6 0 0 11 d 1999 3 7 0 12 e 1995 1 2 3 13 e 1998 1 2 3 14 e 1999 6
2011 Mar 22
2
Data frame and function that requires vector as input
Hi, I have a data.frame(zscores) that looks like this: gA gB g1 0.2 0.6 g2 0.3 Na My problem is that I need to use a function and the output is a vector of only the non NA values, so shorter than the list I would obtain dropping the data.frame. What is the cleanest way to keep row and column names or putting the values back into the same data frame format? The function
2012 Nov 30
4
qbinom
a=c(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9) b=c(0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1) cor(a,b)= -1 a'=qbinom(a, 1, 0.5) b'=qbinom(b, 1, 0.5) why cor(a',b') becomes -0.5 ? -- View this message in context: http://r.789695.n4.nabble.com/qbinom-tp4651460.html Sent from the R help mailing list archive at Nabble.com.