search for: jpntsang

Displaying 13 results from an estimated 13 matches for "jpntsang".

Did you mean: jpetrang
2011 Oct 14
3
Split a list
I have a list of dataframes i.e. each list element is a dataframe with three columns and differing number of rows. The third column takes on only two values. I wish to split the list into two sublists based on the value of the third column of the list element.  Second issue with lists as well. I would like to reduce each of the sublist based on the range of the second column, i.e. if the range of
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 Feb 25
2
Rearranging entries in a matrix
I have a matrix, called data. I used the code below to rearrange the data such that the first column remains the same, but the y value falls under either columns 2, 3 or 4, depending on the value of z. If z=1 for example, then the value of y will fall under column 2, if z=2, the value of y falls under column 3, and so on. data x y z [1,] 50 13 1 [2,] 14 8 2 [3,] 3 7 3 [4,] 4 16 1 [5,] 6
2010 Feb 28
4
Reducing a matrix
I wish to rearrange the matrix, df, such that all there are not repeated x values. Particularly, for each value of x that is reated, the corresponded y value should fall under the appropriate column. For example, the x value 3 appears 4 times under the different columns of y, i.e. y1,y2,y3,y4. The output should be such that for the lone value of 3 selected for x, the corresponding row entries
2011 Dec 05
1
plot mixed variables
My data consists of a numeric (yy) variable and a categorical (xx) variable, as shown below. xx = c(rep("C", 5), rep("D",5)) yy = rnorm(10, 0, 4) xx1 = as.integer(as.factor(xx))   plot(xx1, yy, ylim = c(-13.5, 4), col="blue")   I wish to generate a scatter plot of the data such that instead of 1 it prints C, and instead of 2, it prints D on the x- axis.
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
2010 Mar 12
2
Handling repeated values differently
mat is a matrix with X and Y values. > mat X Y [1,] 56 20 [2,] 56 21 [3,] 2 50 [4,] 3 46 [5,] 18 77 [6,] 57 12 [7,] 57 36 [8,] 95 45 [9,] 65 23 [10,] 33 25 [11,] 33 98 [12,] 63 96 [13,] 66 75 [14,] 99 54 [15,] 78 65 [16,] 75 69 [17,] 54 68 [18,] 54 67 [19,] 0 22 [20,] 14 74 [21,] 15 52 [22,] 46 10 [23,] 6 20 [24,] 6 30 As you can see, some of the X values repeat. I wish
2010 Mar 05
2
Selecting rows of a matrix based on some condition on the columns
The data set consists of two sets of matrices, as labelled by the columns, T's and C's. > xy x T1 T2 T3 T4 T5 C1 C2 C3 C4 C5 [1,] 50 0.00 0.00 33.75 0.00 0.00 0.00 36.76 0.00 35.26 0.00 [2,] 13 34.41 0.00 0.00 36.64 32.86 34.11 35.80 37.74 0.00 0.00 [3,] 14 35.85 0.00 33.88 36.68 34.88 34.58 0.00 32.75 37.45 0.00 [4,] 33 34.56
2009 Dec 07
0
Bootstrap pvalues
Hi, How do I generate bootstrap p-values for goodness of fit test. Thank you in advance for your help, Juliet [[alternative HTML version deleted]]
2009 Dec 15
1
R CMD check in Vista
I used R CMD check in windows vista, and it gives me the message 'sh' is not recognized as an internal or external command. How do I get around this, your help would be highly appreciated. [[alternative HTML version deleted]]
2010 Sep 06
1
How to get "mypkg-manual.pdf"
I am building a package say mypkg. Five months ago, when I built the package I got the mypkg manual in pdf format. Today, after making updates, I build the same package, same name, and steps; unfortunately I do not get the manual in pdf format. Rather I get the following message: cd: can't cd to /cygdrive/c/Documents saving output to 'mypkg-manual.pdf' ...Done Could any one
2010 Oct 20
0
bootstrapping nonlinear mixed effects models
In order to bootstrap nonlinear regression, the following code works. library(nlme) data(Soybean) fm1.nls <- nls(weight ~ SSlogis(Time, a, b, c), data=Soybean) summary(fm1.nls) bstat <- function(A, indices) { mboot <- nls(weight ~ SSlogis(Time, a, b, c), data=Soybean[indices, ]) return(coef(mboot)) } require(boot) boot1 <- boot(Soybean, bstat, 2000) boot1 For nonlinear mixed
2012 Feb 20
1
counting characters starting point
I have three character strings represented below as seq1, seq2, and seq3. Each string has a reference character different from the other. Thus, for seq1, the reference character is U, seq2, S (3rd S from left where A is leftmost character) and for seq3 Y. seq1 = PQRTUWXYseq2 = AQSDSSDHRSseq3 = EEZYJKFFBHO I wish to generate a 3 by 26 matrix where 3 represent seq1, seq2, seq3 and 26 the letters of