Displaying 20 results from an estimated 9000 matches similar to: "How to calculate correlation matrix for 128 * 12625 matrix"
2006 Jul 27
2
Vector extracted from a matrix. How can I specify dimensions in as.matrix?
Transpose vector extracted from a matrix
Hello,
I am doing a recursive analysis that uses every line (vector) of a matrix in
a loop. In the model, I need to transpose those vectors that are extracted
from a matrix.
Using simple vectors (no matrix involved) the transpose function works fine:
simplevector <-matrix(1:3,3,1)
tsimplevector <-t(simplevector) #transposed
dim(simplevector)
2002 Aug 22
3
correlation
Dear All,
I have a file (a matrix) on which I have to compute the correlations.
The function "cov" compute the correlations
between the columns of a matrix, but I want to compute the correlations
between the raws.
Can somebody say to me how I can carry out that?
Thanks
Laurence
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list --
2006 May 28
1
problems while correlating values
Hi,
I am a newbie to the world of R.
I have a data converted in csv format. Few cells in
some of the rows of the data are blank ( in the sense
that there is no value available for the particular
experiment). When i try to open the file in R. I get
an warning message.
The specific warning message i get is
{Warning message:
NAs introduced by coercion }
My data more or less looks like this
-
2008 Apr 15
2
Transposing Data Frame does not return numeric entries
x <- read.table("LittleGarvin.csv", sep=",", header=TRUE)
y <- t(x)
str(y)
chr [1:193, 1:288] "oligocha" "0" " 0" " 0" " 0" "0" ...
- attr(*, "dimnames")=List of 2
..$ : chr [1:193] "X" "upwd1201" "upwd0502" "upwd0702" ...
..$ : NULL
x is a data frame with
2005 Nov 09
2
how to convert strings back to values?
Dear All,
It's Eszter from Hungary, a total beginner with R. My problem is the
following:
I have a dataset with binary values as a comma separated textfile. The
samples are in the coloumns and the species are in the rows.
I have to transpose it for the further PCoA analysis. There is no
problem with reading the dataset.
When I transpose the dataset, the original values become
2010 Jun 05
5
Matrix to Vector
Given a matrix of m*n, I want to reorder it as a vector, using a row major
transpose.
so:
> m<-matrix(seq(1,48),nrow=6,byrow=T)
> m
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
[1,] 1 2 3 4 5 6 7 8
[2,] 9 10 11 12 13 14 15 16
[3,] 17 18 19 20 21 22 23 24
[4,] 25 26 27 28 29 30 31 32
[5,] 33 34 35 36 37
2011 Nov 16
4
Pairwise correlation
Dear All,
I am not familiar with R yet I want to use it to perform some task, hence my
posting here. I hope someone can help.
I have a set of data, genes (rows) and samples (columns). I want to do a
Pearson correlation on all the possible pairwise combinations of all the
genes (2000). Does anyone have an idea of how to execute this in R?
Thanks in advance.
--
View this message in context:
2010 Nov 13
2
how to store a vector of vectors
Hi,
I'm trying to write a function to determine the euclidean distance
between x (one point) and y (a set of n points). How should I pass y to
the function? Until now, I used a matrix like that:
| [,1] [,2] [,3]
[1,] 0 2 1
[2,] 1 1 1
|
Which would pass the points (0,2,1) and (1,1,1) to that function.
However, when I pass x as a normal (column) vector,
2012 Mar 20
2
Reshaping data from long to wide without a "timevar"
Hello All,
I was wondering if it's possible to reshape data from long to wide in R without using a "timevar". I've pasted some sample data below along with some code. The data are sorted by Subject and Drug. I want to transpose the Drug variable into multiple columns in alphabetical order.
My data have a variable called "RowNo" that functions almost like a
2009 Jul 18
7
Question on qplot
Hi, suppose I have following codes :
library(zoo); library(ggplot2)
dat <- matrix(rnorm(500*2), 500); dat <- zooreg(dat, start =
as.Date("01/01/01", "%m/%d/%y"), frequency=1); plot(dat)
head(dat); month.no <- format(index(dat), "%m"); dat1 <-
cbind(coredata(dat), as.numeric(month.no))
x <- dat1[,1]; y <- dat1[,2]; z <- dat1[,3]
Now I draw a
2010 Sep 01
2
getting column names of row-by-row sorted matrix
Hi folks,
I want to sort a matrix row-by-row and create a new matrix that contains the corresponding colnames of the original matrix.
E.g.
> set.seed(123)
> a <- matrix(rnorm(20), ncol=4); colnames(a) <- c("A","B","C","D")
> a
A B C D
[1,] -0.56047565 1.7150650 1.2240818 1.7869131
[2,]
2009 May 15
2
transposing/rotating XY in a 3D array
Dear list,
We have a number of files containing similarly structured data:
file1:
A B C
1 2 3
4 5 6
file2:
A B C
7 8 9
10 11 12
... etc
My part of R receives all these data as an array: 1,2,3... 12 together
with info about dimensions (row,col,fileN) . (
Converting the data into 3D cannot simply done by:
array(x, c(2,3,2))
because breaks the structure (e.g. 1,3,5 is type mismatch)
2003 Apr 07
1
Error: child 12625 (imap) killed with signal 12
Hi!
I have tried to install dovecot as my imap service on my FreeBSD server.
At first all looked fine and worked flawless. But after a while i started
to get errors. The imap process dies with signal 12 when the client tries
to check the contens of the folder.
dovecot: Apr 07 09:55:17 Error: child 12625 (imap) killed with signal 12
Any ideas what may cause this problem?
MvH Johan Willard
2006 Jun 15
4
help with table partition
Hi,
I have a test_table where the dim is 62220 by 73 (row by col)
I would like to partition the rows into 170 equal parts (170 tables
where each is of dim 366 by 73), and rearrange them horizontally. The
source codes I have:
for (i in 1:170) {
c = cbind(c,test_table[(367*i+1):(367*(i+1)),2:73]);
}
Unfortunately, using for loop and cbind for a table of this size
2010 Jan 29
2
question about transpose
Hi all,
if I transpose a matrix with t(data), the newly created colums do not appear to have the first row as header. How can I do to have all the newly created columns have their first row as a header?
Thanks
Gabriele Zoppoli, MD
Ph.D. Fellow, Experimental and Clinical Oncology and Hematology, University of Genova, Genova, Italy
Guest Researcher, LMP, NCI, NIH, Bethesda MD
Work: 301-451-8575
2011 Apr 09
3
In need of help with correlations
I am in need of someone's help in correlating gene expression. I'm somewhat
new to R, and can't seem to find anyone local to help me with what I think
is a simple problem.
I need to obtain pearson and spearman correlation coefficients, and
corresponding p-values for all of the genes in my dataset that correlate to
one specific gene of interest. I'm working with mouse Affymetrix
2013 Jan 25
2
resizing data
Undoubtedly this question has been asked before, I just can't seem to find
the combination of search terms to produce it. I'm trying to resize a
dataset that is pulled into R using read.table. However, I think the same
problem can be produced using matrix:
x<-matrix(1:64,8)
x
# [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#[1,] 1 9 17 25 33 41 49 57
#[2,] 2 10
2009 Dec 04
1
how to calculate covariance matrix in R? why cov doesn't work
Hello,
Sorry. It may be a stupid question.
I have two vectors
a<-c(9,3,5)
b<-c(3,4,1)
How can I get the variance-covariance matrix of these two vectors?
I tried cov(a,b), I got a number not a matrix.
I tried to transpose vector a and b as t(a) and t(b), it still cannot work.
Any suggestions? Thank a lot!
--
View this message in context:
2004 Jan 09
1
Call and memory
I use a large real matrix, X, in C code that is passed from R and
transposed in place in the C code. I would like to conserve memory and,
if possible, allocate space for only one copy of X -- hence I would like
to pass a pointer to the data in the X object to the C code.
The Writing R Extensions manual says that neither .Call nor .External
copy their arguments. They also say that these
2010 Mar 17
3
Converting "factors" to "numeric" in a dataframe
I am currently trying to write a program that minimises the amount of work
required for “auditable” qPCR data. At the moment I am using an Excel (.csv)
spreadsheet as source data that has been transposed to the column format
required for R to read. Unfortunately, this means I have* *to manually
confirm the whole data set prior to doing any analysis, which is taking a
considerable amount of time!