Displaying 6 results from an estimated 6 matches for "oldmatrix".
Did you mean:
glmatrix
2007 Feb 27
5
Multiple conditional without if
...h has about 500 rows and 6 columns.
now i want to kick some data out.
i want create a new matrix which is basically the old one except for all
entries which have a 4 in the 5 column AND a 1 in the 6th column.
i tried the following but couldnĀ“t get a new matrix, just some wierd
errors:
newmatrix=oldmatrix[,2][oldmatrix[,5]==4]&&oldmatrix[,2][oldmatrix[,6]
==1]
all i get is:
numeric(0)
does anybody have an idea how to fix this one ?
thx in advance
matthias
[[alternative HTML version deleted]]
2012 Jul 12
3
Add row into a Matrix witout headers from Function
Hi,
Here i have a matrix like this,
OLDMatrix <-
X1 X2 X3
----- ------ ------
22 24 23
25 27 27
10 13 15
the thing is,
im running two function(SUM,COUNT) to get output in another matrix called
NEWMatrix
NEWMatrix <- c("SUM",colSums(OLDMatrix ))
NEWMatri...
2005 Apr 21
1
large matrix
Dear R-users
I need to convert a matrix with three columns in a new array with
multiple columns.
For example,
oldmatrix
1 4 5
1 54 52
1 9 43
2 32 5
2 54 6
2 76 6
3 54 54
3 543 7
3 54 6
newmatrix
5 5 54
52 6 7
43 6 6
if the first column have a new value then add a column to the new
matrix and the new[i,j] <- old[,3][i]
I write this code, but my initial matrix is very large and the
convertion i...
2013 Feb 13
1
WriteXLS: 'object not found' error within function
...))
flush.console()
[1] "list"
At least I would have thought this would have ruled out any scope-related issues. Has anyone else had this problem or have any ideas why it might be happening?
Thanks,
Scott
PS here is the function in full:
makeTables <- function(design, designInfo, oldMatrix, matrix, annot, tableList)
{
rownames(design) <- designInfo[,1]
fit <- lmFit(matrix, design)
fit <- eBayes(fit)
tables<-list()
for (i in 1:length(tableList))
{
table <- makeTable(oldMatrix, matrix, annot, fit, tableList[i])
print(paste(tableList[i], "=", sep="&q...
2010 Jan 28
2
NA Replacement by lowest value?
...ply(orig.df, 2, function(col) # Change negative values to a small value, close to zero
{
min.val = min(col[col > 0])
col[col < 0] = (min.val / 10)
col # Column index
}))
I think this is how to start, but the NA replacement part doesn't work...
newMatrix = as.matrix(apply(oldMatrix, 2, function(col)
{
min.val = min(mData, na.rm = T) # Find the smallest value in the dataset
col[col == NA] = (min.val / 10) # Doesn't work...
col # Column index
}
Does any of you have any suggestions?
Best regards,
Joel
______________________________...
2008 Jan 13
2
Retrieve only part of a matrix
Hi All,
I'm new with R; this is a basic question. I was given a matrix I of (nrow,
ncol), I would like to create another matrix A with some data in the matrix
I, say [1,4] (row 1, column 4) to [271,19000] (row 271, column 19000). How
do I do this? Please help. Thank you very much.
--mc
[[alternative HTML version deleted]]