similar to: finding common elements in a list

Displaying 20 results from an estimated 9000 matches similar to: "finding common elements in a list"

2005 Apr 20
3
if(foo == TRUE) .. etc
Martin Maechler wrote: > More generally, please, please, everyone : > > Replace > if (something == TRUE) > with if (something) > and > if (something.or.other == FALSE) > with if (!something.or.other) Amen! And right on! And you tell 'em! And a few other exclamations, several of which are not suitable for a family program. That sort of syntax,
2005 Aug 22
1
cbind and rbind
Hi, I have been trying for a while to use cbind and rbind to add a row and column to the same table but seem to be able only to add one OR the other??? Any help would be most welcome, Tony Evans Australia [[alternative HTML version deleted]]
2005 Apr 29
2
congratulations to the JGR developers
Just want to offer my congratulations to the JGR developers as the recepient of the 2005 Chambers Award. Great job, guys!! http://stats.math.uni-augsburg.de/JGR/ [Now, could JGR be updated to work with 2.1.0 (or be made R version independent, please... 8-)] Best, Andy
2004 Nov 11
6
scan or source a text file into a list
I've ported somebody else's rather cumbersome Matlab model to R for colleagues that want a free build of the model with the same type of I/O. The Matlab model reads a text file with the initial parameters specified as: C:\Data\Carluc\Rport>more Params.R # Number of years to simulate nYears = 50; # Initial year for graphing purposes year0 = 1970; # NPP/GPP ratio (cpp0 unitless) fnr =
2006 Mar 10
1
add trend line to each group of data in: xyplot(y1+y2 ~ x | grp...
Although this should be trivial, I'm having a spot of trouble. I want to make a lattice plot of the format y1+y2 ~ x | grp but then fit a lm to each y variable and add an abline of those models in different colors. If the xyplot followed y~x|grp I would write a panel function as below, but I'm unsure of how to do that with y1 and y2 without reshaping the data before hand. Thoughts
2005 Nov 10
2
ltext - adding text to each panel from a matrix
Hi all (really probably just Deepayan): In the plot below I want to add text on either side of each violin plot that indicates the number of observations that are either positive or negative. I'm trying to do this with ltext() and I've also monkeyed about with panel.text(). The code below is generally what I want but my calls to ltext() are wrong and I'm not sure how to fix them.
2002 May 18
3
checkerboard plot?
Hi, I've been doing a lot of CA modeling lately and am now wanting to make some checkerboard plots in R. Let's say I have a matrix: > is.matrix(junk) [1] TRUE > junk [,1] [,2] [,3] [,4] [,5] [1,] 0 0 1 0 0 [2,] 0 1 1 1 0 [3,] 0 1 0 0 1 [4,] 0 1 1 1 1 [5,] 0 1 0 0 0 > and I want to make a
2011 Jul 06
3
finding the intersection of two vectors
Hi, Suppose I have two vectors, not necessarily the same length (in fact, they usually are different lengths): y.1 that has increasing values between 0 and 1; y.2 that has decreasing values between 1.0 and 0. You can picture these as being supply (= y.1) and demand (= y.2) curves from economics. I typically plot these vectors on the same graph against a common x variable, which happens to
2003 May 13
3
Sorting a matrix in an odd way
Hi, I have a matrix not unlike this: foo <- matrix(,5,5) foo[5,1] <- 1 foo[1:3,2] <- 1 foo[3:4,3] <- 1 foo[4:5,4] <- 1 foo[2:4,5] <- 1 foo [,1] [,2] [,3] [,4] [,5] [1,] NA 1 NA NA NA [2,] NA 1 NA NA 1 [3,] NA 1 1 NA 1 [4,] NA NA 1 1 1 [5,] 1 NA NA 1 NA I want to get a vector that is the column numbers as sorted
2009 Jul 16
2
Finding missing elements by comparing vectors
Hi, Is there a function in R to do a-b where a and b are two non-numeric sets (or intersection complement of these two sets). Kind Regards, Praveen. [[alternative HTML version deleted]]
2011 Nov 04
1
Counting number of common elements between the rows of two different matrices
Hello I'm trying to solve this problem without using a for loop but I have so far failed to find a solution. I have two matrices of K columns each, e.g. (K=5), and with numbers of row N_A and N_B respectively A = (1 5 3 8 15; 2 7 20 11 13; 12 19 20 21 43) B = (2 6 30 8 16; 3 8 19 11 13) (the actual matrices have hundreds of thousands of entry, that's why I'm keen to avoid
2012 Feb 02
3
How to get intersection of multiple vectors?
v1<-c("a","b","c","d") v2<-c("a","b","e") v3<-c("a","f","g") I want to get the intersection of v1,v2,v3,ie "a" How can I do then? What I know is only for 2 vectors via "intersect" function,but don't know how to deal with multiple vectors. Many thanks
2008 Feb 20
2
intersecting rows of a matrix
useR's, First, I would like to say thanks to John Fox for providing this segment of code to perform intersection for multiple sets: intersection <- function(x, y, ...){ if (missing(...)) intersect(x, y) else intersect(x, intersection(y, ...)) } I want to execute this function on the rows of a matrix I have: Ik.mat.test <- matrix(c(2,3,6,1,2,6,6,1,2),byrow=T,nrow=3) > Ik.mat.test
2004 Jul 08
4
read.frame
Hello group, I am learning R and I am new to many concepts.I face the following errors when I am trying to execute the following. I have 4 text files with protein accession numbers. I wanted to represent them in a venn diagram and for that I using intersect and setdiff functions. My data looks like this: file1.txt (c): NP_000005 NP_000020 NP_000030 NP_000053 file2.txt(e): NP_000005 NP_000020
2007 Apr 24
5
intersect more than two sets
Hi, I searched the archives and did not find a good solution to that. assume I have 10 sets and I want to have the common character elements of them. how could i do that? -- Weiwei Shi, Ph.D Research Scientist GeneGO, Inc. "Did you always know?" "No, I did not. But I believed..." ---Matrix III
2004 Nov 17
4
summary.lme() vs. anova.lme()
Dear R list: I modelled changes in a variable (mconc) over time (d) for individuals (replicate) given one of three treatments (treatment) using: mconc.lme <- lme(mconc~treatment*poly(d,2), random=~poly(d,2)|replicate, data=my.data) summary(mconc.lme) shows that the linear coefficient of one of the treatments is significantly different to zero, viz. Value Std.Error
2009 Dec 02
3
documentation of intersect() on string vector and num vector and on duplicated elements
> intersect(c(1,3,2),c('1','3')) [1] "1" "3" Apparently, intersect() treats num as string. But this is not documented in the help. Could somebody add it in the future version of R? Also according to the help, the argument should not have duplicated elements. But I tried the following example, it seems that it doesn't matter where there are duplicated
2007 Jun 15
1
A question about logical controls and function arguements
Dear R-help subscribers, I'm trying to write a function to generate data simulating the image created by a point radiation source in a plane on a screen where there is filter with a single circular aperture in it between the source and the screen. Following some guides (including Intro to R and some I found online) and examples I have specified the function (full code below question) with
2008 May 28
1
Multiple Intersections
Hi all, I don't know if this is the correct venue for this question, but I am sure that someone will correct me if I am in the wrong list. I have been searching throughout R for a function that can find the intersection of multiple sets of "things". Say for instance, I have a list of $n$ character vectors and would like to find the intersection of all $k$ subsets. I don't
2011 Feb 22
2
How to find points of intersection between harmonic function and a line
Hi, Sorry for the very short explanation about the problem of intersection. I have a wave function monitored from the heart beat in a particular interval of times.?Apart?fom that, there is?a line with positive slope (e.g: y = x+2) which lies across the wave and intersect on a number of points. My problem is i have no exact equation for?such a?complex harmonic wave produced by the heart