Displaying 20 results from an estimated 20000 matches similar to: "intersect character"
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
2011 Oct 25
1
question regarding intersect function
Hi
I have probably a very simple question but I'm going crazy trying to find
the solution.
I have two data.frames with headers and I'm doing an intersection between
them by names, such that the intersected data.frames are returned by:
df1[intersect(names (df1), names(df2))] and the same for df2
Now, I want to have all the opposite data that did not intersect. I tried to
do:
2013 Sep 01
1
Intersect 2 lists+bring extra columns
Hi everyone,
I am pretty new to R, so be patient.
I am trying to intersect 2 columns and in the rows that intersect, I want
information from the 3rd column to be brought with it. I think it will be
easier to explain with an example example.csv
<http://r.789695.n4.nabble.com/file/n4675136/example.csv> .
In my example, I have a reference list of fruit (first column), and my fruit
of
2010 May 20
1
intersect() without discarding duplicates?
Hi all,
The ?intersect entry kindly points out that it discards duplicate
entries. I'm looking, however, to get the intersection while KEEPING
duplicate entries, and there are no instructions on how to accomplish this
using intersect().
Does anybody have any idea how this might be done, or am I going to need to
program something from scratch (something like ordering the vectors and then
2005 Sep 21
3
ts.intersect bug?
This code gives an error:
a <- ts(1:10, start=0, freq=10)
b <- ts(1:10, start=1, freq=10)
ts.intersect(a,b)
This one works normally (and correctly):
a <- ts(1:10, start=0)
b <- ts(1:10, start=1)
ts.intersect(a,b)
Antonio, Fabio Di Narzo.
P.S. How to switch off italian error messages to post on r-help?
> version
_
platform i386-pc-mingw32
arch i386
os
2005 Jun 03
1
ts.intersect a multivariate and univariate ts
This seems like a FAQ, but I can't figure it out.
I have a mv ts object:
R > tsp(pg)
[1] 1982 2003 1
R > dim(pg)
[1] 22 12
and a univariate ts:
R > tsp(rw)
[1] 1690 1996 1
Yet, when I try to intersect them:
R > tsp(ts.intersect(rw, pg))
[1] 1982 2176 1
the process goes awry.
How to I get rw and pg to be one ts that runs from 1982 to 1996 and has 13
univariate time
2009 Aug 10
1
index of intersect()
Hi all,
Is there a way to get the index of elements in intersect(x,y) where x and y
are vectors with few common elements.
Appreciate your response.
Praveen Surendran.
[[alternative HTML version deleted]]
2010 Mar 18
1
Intersect, Union of date/time ranges
I have 2 sets of data which defines the start and end of date/time
periods. I want to be able to obtain the following:
1) The intersect of those 2 sets of date/time ranges i.e. return
start/end date/time ranges where both sets overlap
2) The union of those 2 sets of date/time ranges i.e. return the
start/end date/time ranges which are in 1 or both sets
Is there anything that is currently able
2008 Sep 04
1
Building a time series.
I have a need to build a time series and there are a couple of aspects about the time series object that are confusing me. First it seems that ts.union is not doing what I would expect. For example:
x0 <- rep(0,10)
x1 <- rep(1,10)
xt0 <- ts(x0, frequency=10)
xt1 <- ts(x1, frequency=10)
st2 <- ts.union(xt0, xt1)
> xt2
Time Series:
Start = c(1, 1)
End = c(1, 10)
Frequency = 10
2007 May 06
1
intersect of 2 data frames
Greetings!
I am a new user of R. The only one in my department, all others use SPSS.
I have two data sets of students with test scores, pretest and
posttest. The first column StuNum and then columns of scores.
The problem is that the lists are slightly different not all students
are in both data sets.
So I did:
intersect(pretest$StuNum, posttest$StuNum) -> common.id
At this point I need
2003 Aug 06
1
contour lines intersect
Hi,
Sorry if this is already known...
contour() sometimes draws contour lines that intersect.
Is there a temporary fix?
A dataset which causes problems is at
http://www.maths.uwa.edu.au/~adrian/dumpdata.R
If you try just
source("dumpdata.R")
image(huh)
contour(huh)
the 100 x 100 matrix 'huh' contains an hourglass-shaped region
of values around 0.8. The contour plot
2007 Apr 30
1
intersect filled.contour and polygon
Dear R users;
Is there any way to intersect a filled contour image and a polygon? My
problem is that I want to create a kriging map and the boundaries of
my map are given by the coordinates of the polygon.
So far I can superompose the polygon in the filled.contour image but I
don't know how to get rid of the contour image outside of the polygon
boundaries.
Any hint will be appreciated
PM
2013 Jul 18
3
setdiff y/o intersect para diferencias entre vectores
hola,
tengo dos vectores de 1134 y 385 elementos que se corresponden con números de accesión de genes. Necesito saber que números son comunes o intersección de vectores.
He utilizado intersect(x,y) y me da todo el rato un único valor:
V1 V1.1 V1.2 V1.3 V1.4 V1.5 V1.6 V1.7 V1.8 V1.9 V1.10 V1.11 V1.12
1 AJ558305 AJ558305 AJ558305 AJ558305 AJ558305
2005 May 05
2
Intersection of more than two groups in one function?
Hi all,
As far as I can tell, the only canned way to do an intersect between two
vectors of ints is the intersect(vec1, vec2) function -- is there another
function I'm missing for intersecting more than two vectors??
TIA,
Ken
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
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
2010 Aug 10
3
Intersecting list vs rows in matrix
Know that if I have List_1 and List_2 that I can check to see if the
intersect via the code below:
List _1:
a, b, c, d, e, f, g
List_2:
z, y, x, w, v, u, b
length(intersect(List_1, List_2)) > 0
return = true
If instead I wanted to check a dataframe that is a "list of lists," how
would I do that by record without looping?
List _1:
a, b, c, d, e, f, g
List_2:
z, y, x, w, v,
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
2009 Oct 14
2
Getting indeices of intersecting elements.
Hi,
Is there a command to get the indices of intersecting elements of two
vectors as intersect() will give the elements and not its indices.
Thanks in advance.
Praveen Surendran
School of Medicine and Medical Sciences
University College Dublin
Belfield, Dublin 4
Ireland.
[[alternative HTML version deleted]]
2007 Mar 29
0
(PR#9589) 'union' does not handle factors while 'intersect'
This is not a bug, nor is the subject line true: both do accept
factors but what they do with factors is undocumented. From the help
(not 'man') page
Performs *set* union, intersection, (asymmetric!) difference,
equality and membership on two vectors.
^^^^^^^
so it is not said to work on factors. I disagree that what intersect()
for