similar to: Selective subsetting

Displaying 20 results from an estimated 10000 matches similar to: "Selective subsetting"

2006 Aug 10
3
Multiple density curves
Hi, I am new to R...a recent convert from SAS. I have a dataset that looks like this: SEQ A1 A2 A 532.5 554.5 B 25.5 35.5 C 265.2 522.2 D 245.55 521.56 E 546.52 141.52 F 243.25 32.56 G 452.55 635.56 H 15.14 16.54 I 543.4 646.56 J 54.4 654.5 K 646.5 64.54 L 645.4 614.46 M 646.54 634.46 I want to make a histogram
2006 Aug 29
1
Dendrogram troubles
Hi, I am making a dendrogram with 180 terminal values. Whether I keep it horizontal or vertical, it gives a 'squished' graph that refuses to be stretched beyond the window size and I cannot read the labels. (I'm using hclust and then plot to make the tree.) Is there a way to stretch the graph in R, or by exporting it somehow, so that I can read the 180 values and see what the results
2006 Sep 03
1
Memory issues
Hi, I'm using R on Windows and upgraded the computer memory to 4GB, as R was telling me that it is out of memory (for making heatmaps). It still says that the maximum memory is 1024Mb, even if I increase it using memory.limit and memory.size. Is there a way to permanently increase R's memory quota to 4GB? Please help. Many thanks, -DS. [[alternative HTML version deleted]]
2012 Oct 26
1
Creating a correlation matrix from a vector
I'm looking to create a correlation matrix, but I have already obtained the correlations, which are stored in a vector. (Basically, I'm running a simulation which requires a correlation matrix, but I am simulating the various correlations.) My aim is to create a function that can take the vector, and fit the values into their respective locations in a correlation matrix. (The correlations
2007 Jun 25
2
Re : Half of a heatmap
> I am trying to produce a heatmap of pairwise correlations, but since the matrix is > symmetric, I only need either the upper or the lower triangle. I have scoured the > web and R documentation, but I have not been able to find a way to produce such a > figure. Is there a simple way to produce a heat map with only the part above or > below the diagonal? You might want to check
2007 Aug 16
6
an easy way to construct this special matirx
Hi, Sorry if this is a repost. I searched but found no results. I am wondering if it is an easy way to construct the following matrix: r 1 0 0 0 r^2 r 1 0 0 r^3 r^2 r 1 0 r^4 r^3 r^2 r 1 where r could be any number. Thanks. Wen [[alternative HTML version deleted]]
2005 Jan 20
3
Constructing Matrices
Dear List: I am working to construct a matrix of a particular form. For the most part, developing the matrix is simple and is built as follows: vl.mat<-matrix(c(0,0,0,0,0,64,0,0,0,0,64,0,0,0,0,64),nc=4) Now to expand this matrix to be block-diagonal, I do the following: sample.size <- 100 # number of individual students I<- diag(sample.size) bd.mat<-kronecker(I,vl.mat) This
2011 Jun 02
4
generating random covariance matrices (with a uniform distribution of correlations)
List members, Via searches I've seen similar discussion of this topic but have not seen resolution of the particular issue I am experiencing. If my search on this topic failed, I apologize for the redundancy. I am attempting to generate random covariance matrices but would like the corresponding correlations to be uniformly distributed between -1 and 1. The approach I have been using is:
2008 Nov 21
2
Extracting diagonal matrix
Dear All, I have a correlation matrix of size 100 x 100 and would like to extract the diagonal matrix from it. I have used the for loop to store tha correlation values of the diagonal matrix. Is there a 'R way' of doing this? Thanks in advance. Kind regards, Ezhil
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
2007 Nov 29
1
?eigen documentation suggestion
from ?eigen symmetric: if 'TRUE', the matrix is assumed to be symmetric (or Hermitian if complex) and only its lower triangle is used. If 'symmetric' is not specified, the matrix is inspected for symmetry. I think that could mislead a naive reader as it suggests that, with symmetric=TRUE, the result of eigen() (vectors and values) depends only on
2004 Jan 12
1
Matrix indexes
Two questions about matrix indexing: Is is correct that V <- V[lower.tri(V, diag=TRUE)] returns the lower triangular of matrix V, that is: all elements above diagonal are set to zero? I understand that the triangle of matrix elements of V for which lower.tri is TRUE are returned while the others (above diagonal) are set to zero (or NA ???). If D and B are vectors of logicals, what
2005 Mar 01
2
almost lower triangular matrices
I have output from a program which produces a distance matrix I want to read into a clustering program in R. The output is a .txt file and is 'almost' lower triangular in the sense that it is just the triangle below the diagonal. So for example a 4-by-4 distance matrix appears as, 1 2 3 4 5 6 i.e. it looks like a lower triangular of a 3-by3. I thought I might be able
2011 Feb 09
2
Generate multivariate normal data with a random correlation matrix
Hi All. I'd like to generate a sample of n observations from a k dimensional multivariate normal distribution with a random correlation matrix. My solution: The lower (or upper) triangle of the correlation matrix has n.tri=(d/2)(d+1)-d entries. Take a uniform sample of n.tri possible correlations (runi(n.tr,-.99,.99) Populate a triangle of the matrix with the sampled correlations Mirror the
2007 Nov 12
1
Using lme (nlme) to find the conditional variance of the random effects
Using lmer in the lme4 package, you can compute the conditional variance-covariance matrix of the random effects using the bVar slot: bVar: A list of the diagonal inner blocks (upper triangles only) of the positive-definite matrices on the diagonal of the inverse of ZtZ+Omega. With the appropriate scale factor (and conversion to a symmetric matrix) these are the conditional variance-covariance
2002 Dec 20
1
lower triangle
Hi, I want to compute the lower triangle of a square matrix (optionally, sans diagonal). With for() loops I can do something like this: ## 5 by 5 matrix rtn for (j in 1:5) { for (k in 1:j) { if (j != k) { ## optional rtn[j, k] <- my.func(j, k) } } } I'd like to do this with apply(). Is there some way I can do this kind of 'short-circuit'? Thanks, Mark Wilkinson
2009 Dec 04
2
selective subsetting of a correlation matrix
Dear All, I have a correlation matrix say 'M' (4000x4000) for 4000 genes and I want to subset it to 'N' (190x190) for 190 genes. The list of those 190 genes are in variable 't'. So the idea is to read the names of genes from variable 't' and subset the matrix M accordingly. Any thoughts are welcome! Best Lee [[alternative HTML version deleted]]
2011 Jan 10
2
Calculating Portfolio Standard deviation
Dear R helpers I have following data stocks <- c("ABC", "DEF", "GHI", "JKL") prices_df <- data.frame(ABC = c(17,24,15,22,16,22,17,22,15,19),                                          DEF = c(22,28,20,20,28,26,29,18,24,21),                                           GHI = c(32,27,32,36,37,37,34,23,25,32),                                          
2011 Apr 04
3
Adjusting p values of a matrix
Dear all, I have an n x n matrix of p-values. The matrix is symmetrical, as it describes the "each against each" p values of correlation coefficients. How can I best correct the p values of the matrix? Notably, the total number of the tests performed is n(n-1)/2, since I do not test the correlation of each variable with itself. That means, I only want to correct one half of the matrix,
2010 May 09
1
Plot polygon in 3D with rgl
Dear R-helpers, an rgl-ers in particular, what is the easiest way to plot a section of a plane in 3D, that is given by the xyz coordinates of the outline? Suppose I have a polygon - which I know for sure is a set of coordinates on the same plane. One method I found is to use surf.tri from the geometry package, and then plot the triangles with rgl.triangles. This method is not perfect though,