Displaying 20 results from an estimated 30000 matches similar to: "matrix lists"
2005 Aug 15
2
queer data set
I have a dataset that is basically structureless. Its dimension varies 
from row to row and sep(s) are a mixture of tab and semi colon (;) and 
example is
HEADER1 HEADER2 HEADER3   HEADER3
A1       B1      C1       X11;X12;X13
A2       B2      C2       X21;X22;X23;X24;X25
A3       B3      C3       
A4       B4      C4       X41;X42;X43
A5       B5      C5       X51
etc., say. Note that a blank
2009 Oct 29
3
Removing & generating data by category
Dear R users,
Basically, from the following arbitrary data set:
a <-
data.frame(id=c(c("A1","A2","A3","A4","A5"),c("A3","A2","A3","A4","A5")),loc=c("B1","B2","B3","B4","B5"),clm=c(rep(("General"),6),rep("Life",4)))
> a
 
2009 Apr 26
2
Help to select the raw in a data.frame with the max value
Dear User,
 
thank for the attention. I have a data.frame with 5 columns (ex:ID,
a1,a2,a3,a4) and 1000 rows. I wish to find the absolute max value for all
data.frame and save a new data.frame with the row where is that value. Ex:
 
ID: 1,2,3,4,5,6,7,8,9,10
a1:1,2,3,4,5,6,7,8,9,10
a2:11,12,13,14,15,16,17,18,19,20
a3:21,22,23,24,25,26,27,28,29,30
a4:31,32,33,34,35,36,37,38,39,40
 
 
The
2011 Aug 08
2
2 questions on matrix manipulation in R
Hi there,
I have two questions on matrix manipulation. For the first one, I 
want to calculate the product of each column of a matrix (say A) with 
another vector (say b). That is, if A has 5 columns (a1, a2, a3, a4, 
a5), I want to obtain a matrix with columns (a1*b, a2*b, aA3*b, a4*b, 
a5*b). Can I do it directly, without using "for" loop?
For the second one, I have a matrix A of
2017 Oct 09
3
Merge me agrega siempre las columnas
Buenas,
Tengo dos data.frames de la siguiente manera
library(data.table)
id<-c("a1","a2","a3","a4")
id2<-c("a2","a3","a1","a4")
y<-c(1,2,3,4)
z<-c(3,5,6,7)
k<-c(1,3,8,7)
df1<-data.table(id,y,z)
id<-c("a2","a3","a1","a4")
df2<-data.table(id,x,y)
Quiero
2005 Mar 19
2
simple problem, but not for me
Hello, I'm new in R and I want to do one thing that is very easy in excel, however, I cant do it in R.
Suppose we have the data frame:
 
data<- data.frame(A=c("a1","a2","a3","a4","a5"))
 
I need to obtain another column in the same data frame (lets say B=c(b1,b2,b3,b4,b5) in the following way:
 
b1=a1/(a1+a2+a3+a4+a5)
2009 Sep 04
1
User defined function's argument as Subset function's input
Dear R users,
I have a data where I desire to subset according to certain conditions.
However, the script is very messy as there are about 30 distinct conditions.
(i.e. same script but with different conditions)
I would like to make a user defined function so that I can input the desired
conditions and just get the results accordingly.
Below is an arbitrary data set & sample statements
2005 Oct 18
1
Solid and dotted lines saving an xyplot
Dear R-users,
I would a small problem saving a graph with postscript after using
xyplot.
Whereas in the R-screen the two lines are solid, once the image is saved
as .eps file the second lines (blue in the following example) is dotted.
Here there is a simple example.
Thanks in advance for your help,
Carlo Giovanni Camarda
# creating data
a1 <- sort(runif(10))
a2 <- sort(runif(10))
a3 <-
2010 Jul 19
1
Calculation of Covariance Matrix Calculation
Hi,
Excuse me for asking this silly question. But I really couldn't understand
why cov() and ccov() don't work for my calculation of covariance matrix.
a <- matrix(1:8, 2, 4)
a
     [,1] [,2] [,3] [,4]
[1,]    1    3    5    7
[2,]    2    4    6    8
> ccov(a)
Error in solve.default(cov, ...) :
  Lapack routine dgesv: system is exactly singular
I also tried colume bind, but it
2008 Mar 25
2
Compare two data sets
I would like to compare two data sets saved as text files (example below) to determine if both sets are identical(or if dat2 is missing information that is included in dat1) and if they are not identical list what information is different between the two sets(ie output "a1", "a3" as the differing information).  The overall purpose would be to remove "a1" and
2010 Apr 13
2
sensitivity analysis, input factors
Hi,
I'm trying to conduct sensitivity analysis in R using the 'sensitivity' package. Although the description of functions seem straightforward, I can?t succeed. The definition of input factors can be the problem. 
library(sensitivity)
#A simple model with 4 input factor to test the morris function:
model01=function(a1,a2,a3,a4)            
{
Z<-numeric(10)
Z[1]<-runif(1)
2018 May 27
1
if else with 4 conditions problem
Hi everyone,
I have two columns:
? ?A? ? ? ? ? ? ? ?B
? ?1? ? ? ? ? ? ? ?1? ?1? ? ? ? ? ? ? ?0
? ?0? ? ? ? ? ? ? ?1
? ?0? ? ? ? ? ? ? ?0
I have 4 categories which are:
1) if A = 1 and B =1 then A1 = 1, else A2 = 0, A3 = 0, A4 = 0
2) if A = 1 and B =0 then A1 = 0, else A2 =1, A3 = 0, A4 = 0
3) if A = 0 and B = 1 then A1 = 0, else A2 = 0, A3 = 1, A4 = 0
4) if A = 0 and B =0 then A1 = 0, else A2 =
2004 Jul 08
2
Getting elements of a matrix by a vector of column indice s
See if the following helps:
> m <- outer(letters[1:5], 1:4, paste, sep="")
> m
     [,1] [,2] [,3] [,4]
[1,] "a1" "a2" "a3" "a4"
[2,] "b1" "b2" "b3" "b4"
[3,] "c1" "c2" "c3" "c4"
[4,] "d1" "d2" "d3" "d4"
[5,]
2010 Sep 27
2
subtraction based on two groups in a dataframe
Hello 
I have a data set like below:
    plate.id well.id   Group      HYB  rlt1
1         P1      A1 Control SKOV3hyb 0.190
2         P1      A2 Control SKOV3hyb 0.210
3         P1      A3 Control SKOV3hyb 0.205
4         P1      A4 Control SKOV3hyb 0.206
5         P1      A5 Control SKOV3hyb 0.184
385       P1      A1    ovca SKOV3hyb 0.184
386       P1      A2    ovca SKOV3hyb 0.229
387      
2008 Feb 10
2
reshape
Dear colleagues,
I'd like to reshape a datafame in a long format to a wide format, but
I do not quite get what I want. Here is an example of the data I've
have (dat):
sp <- c("a", "a", "a", "a", "b", "b", "b", "c", "d", "d", "d", "d")
tr <- c("A",
2009 Jan 11
4
How to get solution of following polynomial?
Hi, I want find all roots for the following polynomial :
a <- c(-0.07, 0.17); b <- c(1, -4); cc <- matrix(c(0.24, 0.00, -0.08,
-0.31), 2); d <- matrix(c(0, 0, -0.13, -0.37), 2); e <- matrix(c(0.2, 0,
-0.06, -0.34), 2)
A1 <- diag(2) + a %*% t(b) + cc; A2 <- -cc + d; A3 <- -d + e; A4 <- -e
fn <- function(z)
   {
    y <- diag(2) - A1*z - A2*z^2 - A3*z^3 - A4*z^4
   
2003 Dec 17
1
TODO hardlink reporting problem - fixed?
On Mon, 15 Dec 2003, jw schultz <jw@pegasys.ws> wrote:
> OK, first pass on TODO complete.
....
This hardlink bug report is nearly 21 months old...  So I took a look
at it using 2.5.7.  See below.
> BUGS ---------------------------------------------------------------
> 
> Fix hardlink reporting                                                2002/03/25
>   (was: There seems
2009 Jul 29
1
Subtract matrices within arrays along indices
I have the following array: 3 dimensional object, one dimension being year.
Object is 3*3*3
library(plyr, reshape)
a1<-rep(c(2007,2008,2009),9)
a2<-c(rep("a",9),rep("b",9),rep("c",9))
a3<-c(rep(c(rep(1,3),rep(2,3),rep(3,3)),3))
a4 <- rnorm(27)
A<-data.frame(cbind(comp=a2,val=a3, year=a1, a4))
A1<-melt(A, id=c("year", "comp",
2010 Jun 17
3
ask a question about data sets element
for example, I have
a1=c(1,3,5)
a2=c(2,4,6)
a3=c(7,8)
a4=c(9,10)
now if I have i=5, so i in a1, then I get a feedback tag[5]=1
                   i=8,  so i in a3, then can get tag[8]=3
in there any function to do this to check the element belongs to which
group?
thank you!!!
	[[alternative HTML version deleted]]
2004 Sep 28
3
sapply behavior
Hi,
I use sapply very frequently, but I have recently noticed a behavior of 
sapply which I don't understand and have never seen before. Basically, 
sapply returns what looks like a matrix,  says it a matrix, and appears to 
let me do matrix things (like transpose). But it is also a list and behaves 
like a list when I subset it, not a vector (so I can't sort a row for 
instance). I