Displaying 20 results from an estimated 11000 matches similar to: "basic subset question of matrix"
2011 Nov 20
1
Deleting multiple rows from a data matrix based on exp value
Dear List,
I have a data matrix that consists of ~4500 rows and 25 columns (i.e.
an exprSet object that I converted via the 'exprs' function into a
data matrix)
Now I want to remove/delete the rows where all exp. values in that
particular row are below or equal to a specific cut-off value (e.g
1.11)
I have tried using several commands to address this issue:
>Matrix[rowSums(Matrix
2011 Oct 11
2
binding all elements of list (character vectors) to a matrix as rows
dear r-users,
i have got a problem which i am trying to solve:
i have got the following commands:
Mymatrix <- matrix(1:9,ncol=3)
Z <-
list("V1"=c("a","",""),"V2"=c("b","",""),"V3"=c("c","",""),"V4"=c("d","",""))
Mymatrix <-
2012 Mar 20
1
Remove individual rows from a matrix based upon a list
Dear All,
Thanks in advance for any help. I have a square matrix of measures of
interactions among individuals and would like to calculate a values from a
function (colSums for example) with a single individual (row) excluded in
each instance. That individual would be returned to the matrix before the
next is removed and the function recalculated. I can do this by hand
removing rows based upon
2012 Jul 19
2
Line chart with a double matrix
Hello,
I have a double matrix that I want to represent in a line chart. Although I
have seen some examples I still don't manage to get it. My data is this (a
double matrix called mymatrix) :
Blogs Wikis Redes Etiq. SPC LMS
Menor de 30 57.14 28.57 14.29 28.57 57.14 28.57
de 31 a 40 63.83 61.70 29.79 17.02 59.57 70.21
de 41 a 50 72.64 70.75 47.17 20.75 55.66 75.47
Mayor de
2006 Apr 04
2
Selecting out certain values from a MATRIX
I have two objects, one matrix and one vector.
I want to use my vector to subset certain values out of my matrix.
For example:
I want to tell R, to select out all rows in myMatrix into a new myMatrix2 IF
that corresponding row is less than a 0.5 in myVector.
So:
myMatrix = a matrix of 8000 by 20
myVector = vector of 8000
myMatrix2 = a matrix of < 8000 by 20 (based on selection criteria in
2007 Mar 01
1
problem with throwing lines out of matrix
Dear all,
again i have a problem with special case of dropping lines out of a
matrix.
i tried the following, where throwout is a vector of length 18 with
simple id values that should be compared to any
for (k in 1:length(throwout))
{
mymatrix=matrix(mymatrix[-(forfact[k]),],ncol=4)
}
this didnt work and i tried the following to find the error:
mymatrix[,1][mymatrix[,1]==throwout[7]]
2010 Aug 10
1
admin users = user0 (how force admin permission?)
Hi folks :-)
in a samba share I've:
valid users = user0 user1 user2 user3
admin users = user0
If I write a new file by user0 (admin) this file has root permission:
-rw-r--r-- 1 root user0 131870 2010-08-06 15:35 20100806 name_of_file
can I force to have an user0 permission like this (maintening admin user
option in samba?):
-rw-r--r-- 1 user0 user0 131870 2010-08-06 15:35
2010 Mar 11
2
Can't convert list to matrix properly
Hi guys, here is a list of names that I have:
MyList:
> myList<-list("A", "B","C","D")
> myList
[[1]]
[1] "A"
[[2]]
[1] "B"
[[3]]
[1] "C"
[[4]]
[1] "D"
I want to turn this list into a matrix of 1 row and 4 columns with those
four components (A, B, C, D) so here is what I do:
myDataFrame <-
2008 May 30
1
application wont work properly
Im using an application called saturn for my university assignement.
The problem is that it fails to fully operate under linux with wine.
If im not mistaken the application works like this:
Satwin is the windows front end that calles *.bat files that are part of the suit saturn.
While wine loads the satwin front end perfectly it fails to execute the *.bat files that are part of the saturn suit.
2012 Jul 31
2
Remove a complete row as per the Range in a Matrix
Hi,
Here i have a Matrix
MyMatrix <-
Name Age
--------- -------
ANTONY 27
IMRAN 30
RAJ 22
NAHAS 32
GEO 42
and here i have an array with Minimum and Maximum values.
MinMaxArray <- data.frame(MIN = 25,MAX=35)
MIN MAX
------ --------
25 35
2009 Jul 20
1
S4 method dispatch with inheritance
Hi,
I'm trying to create a new S4 class (myMatrix) which for now just
extends dgCMatrix (from package Matrix). Then I want to use "[" which is
defined in Matrix.
Out of the box with "[" (defined in Matrix) I lose the class information
and the result is an object of class dgCMatrix. If I specify a
"["-method for myMatrix, it is not used because a signature
2012 Aug 01
1
Error message: $ operator is invalid for atomic vectors
HI,
The code was working perfectly fine yesterday and today, until half an hour ago.? Couldn't find any problems in the code. Still, I am getting error message.
myMatrix <- data.matrix(read.table(text="
Name??????????? Age
ANTONY??????? 27
IMRAN????????? 30
RAJ????????????????? 22
NAHAS????????? 32
GEO??????????????? 42
", header=TRUE))
MinMaxArray? <- data.frame(MIN =
2005 Aug 08
2
computationally singular
Hi,
I have a dataset which has around 138 variables and 30,000 cases. I am
trying to calculate a mahalanobis distance matrix for them and my
procedure is like this:
Suppose my data is stored in mymatrix
> S<-cov(mymatrix) # this is fine
> D<-sapply(1:nrow(mymatrix), function(i) mahalanobis(mymatrix, mymatrix[i,], S))
Error in solve.default(cov, ...) : system is computationally
2011 Aug 17
2
Lattice: problem with setting space between plot and legend
Dear R Users,
I am writing code to present my output data (I'm using Lattice Package).
However, it's essential for me to control space between barchart and legend.
I've read the package's specification, but unfortunately I haven't spot the
information how to do this. Here's the code I've written:
barchart(mymatrix[,1:ncol(mymatrix)],horizontal=FALSE,
2005 Jan 21
6
Avoiding a Loop?
Dear R-Helpers,
I have a matrix where the first column is known. The second column is
the result of multiplying this first column with a constant "const". The
third column is the result of multiplying the second column with
"const".....
So far, I did it like this (as a simplified example):
nr.of.columns <- 4
myconstant <- 27.5
mymatrix <- matrix(numeric(0), nrow=5,
2004 Nov 01
5
make apply() return a list
Hi,
I have a dataframe (say myData) and want to get a list (say myList) that
contains a matrix for each row of the dataframe myData. These matrices are
calculated based on the corresponding row of myData. Using a for()-loop to do
this is very slow. Thus, I tried to use apply(). However, afaik apply() does
only return a list if the matrices have different dimensions, while my
matrices have
2013 Jun 27
3
using "rollapply" to calculate a moving sum or running sum?
#using "rollapply" to calculate a moving sum or running sum?
#I am tryign to use rollapply to calcualte a moving sum? #I tried
rollapply and get the error message
#"Error in seq.default(start.at, NROW(data), by = by) :
# wrong sign in 'by' argument"
#example:
mymatrix <- ( matrix(data=1:100, nrow=5, ncol=20) )
mymatrix_cumsum <- ( matrix(data=NA, nrow=5,
2011 Aug 09
2
S4 classes, some help with the basics
Hi All,
I have tried to find an answer within documentation, but I cannot:
o How can call a class "slot" without knowing the name a priori?
E.g., let's say I use the "pcaMethods" library to create a "pcaRes"
object. How can I call parts of that object without using the specific
names of the object in the call?
example code:
library(pcaMethods)
2012 Jun 14
3
Time difference between two dates/timing
Hi,
Here, i have a matrix like this
MyMatrix <-
*DATETIME HEADER1 HEADER2*
1/1/2010 0:10 197.1947 100.0859
1/1/2010 0:20 203.8811 100.1013
1/1/2010 0:30 206.564 100.0433
1/1/2010 0:40 207.9563 99.9393
i want to get the time difference in minutes between two date.
TimeDiff <- MyMatrix[1,1] - MyMatrix[2,1]
TimeDiff
2005 Dec 08
3
Reshaping data
Dear all,
given I have data in a data.frame which indicate the number of people in
a
specific year at a specific age:
n <- 10
mydf <- data.frame(yr=sample(1:10, size=n, replace=FALSE),
age=sample(1:12, size=n, replace=FALSE),
no=sample(1:10, size=n, replace=FALSE))
Now I would like to make a matrix with (in this simple example)
10 columns (for the