search for: setdiff

Displaying 20 results from an estimated 329 matches for "setdiff".

2009 May 30
3
setdiff bizarre (was: odd behavior out of setdiff)
Dear R-devel, Please see the recent thread on R-help, "Odd Behavior Out of setdiff(...) - addition of duplicate entries is not identified" posted by Jason Rupert. I gave an answer, then read David Winsemius' answer, and then did some follow-up investigation. I would like to change my answer. My current version of setdiff() is acting in a way that I do not understand,...
2009 May 30
3
setdiff bizarre (was: odd behavior out of setdiff)
Dear R-devel, Please see the recent thread on R-help, "Odd Behavior Out of setdiff(...) - addition of duplicate entries is not identified" posted by Jason Rupert. I gave an answer, then read David Winsemius' answer, and then did some follow-up investigation. I would like to change my answer. My current version of setdiff() is acting in a way that I do not understand,...
2009 May 29
2
Odd Behavior Out of setdiff(...) - addition of duplicate entries is not identified
I think I am using the improved version of setdiff(...) that handles data.frames, so I think some odd behavior was expected but this one is escaping me. It appears that the the addition of duplicate entries is not caught by the setdiff(...). Is this expected behavior? If so, is there another method or approach that should be used to identify...
2004 Feb 27
1
question about setdiff()
Thank you for your answers, I have another question: the behaviour of setdiff(indicesFalse, indicesNA) does not seem predictable to me. > indices [1] 1 2 3 4 5 6 > compareVector [1] NA TRUE TRUE TRUE FALSE NA > indicesNA = indices[is.na(compareVector)] > indicesNA [1] 1 6 > indicesFalse = indices[compareVector == FALSE] > indicesFalse [1]...
2007 Dec 10
1
setdiff for data frames
Hello, I have been interested in setdiff() for data frames that operates row-wise. I looked in the documentation, mailing lists, etc., and didn't find exactly the right thing. Given data frames A, B with the same columns, the goal is to extract the rows that are in A, but not in B. Of course, one can usually do setdiff(rownames(A),...
2013 Feb 01
2
how to setdiff on lists of lists
...List, I have a data structure like: > aa [[1]] [1] 1 2 3 [[2]] [1] 4 5 6 > bb [[1]] [1] 3 [[2]] [1] 5 I would like to set differences between "aa" and "bb" and get as result another list of lists like: > res [[1]] [1] 1 2 [[2]] [1] 4 6 I am trying: lapply(aa, setdiff, bb) but I simply get "aa" back as result. Could you please point me in the right direction about the combination of functions that I need to accomplish this task? Best regards, Simone -- Simone Gabbriellini, PhD PostDoc at DISI, University of Bologna mobile: +39 340 39 75 626 email:...
2009 Apr 04
1
comparing columns in a dataframe
...3 versions of a spreadsheet which have been combined into a single dataframe. The aim is to identify which rows have been changed. The dataframe contains 177 rows of data (each cell contains text). 'intersect' produced a file with 35 rows, 'union' a file with 303 rows and 'setdiff' a file with 130 rows Below is the code that I have started with. Ideally I would like to identify the actual row numbers where there is difference in the variables (either pairwise or between 3 variables). x <- read.csv("c://rec_compare.csv",header=T, as.is=TRUE) u <- unio...
2012 Aug 14
1
Can we interlink these three if conditions?
key1.=c(1, 2, 3) key2.=c(2) if (identical(key1.,key2.) == "TRUE") { cat("No Errors found") } if (length(setdiff(key1., key2.)) !=0) { cat("Reference.ID_Trial.ID_Arm.ID_SubArm.ID\n\n") cat(paste(setdiff(key1., key2.)), sep="\n")...
2010 Jul 29
4
looking for setdiff equivalent on dataset
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20100729/2fc86d3d/attachment.pl>
1999 Jul 20
2
tensor() function and sets
Hi Everyone, To complete the outer() and kronecker() functions in the base, may I suggest the following tensor() function, which allows the multiplication of arrays through sets of conformable dimensions. I am happy to write a help page if required. The code also needs a setdiff() function which prompts me to ask: what about simple set functions? I expect many of us have written our own (Brian has a setdiff() in drop1.lm(), for example), which seems like a good reason for putting versions in the base. I would be happy to provide mine for general scrutiny. Cheers, Jonath...
2013 Jul 18
3
setdiff y/o intersect para diferencias entre vectores
...58305 AJ558305 AJ558305 AJ558305 AJ558305 AJ558305 AJ558305 AJ558305 AJ558305 AJ558305 AJ558305 AJ558305 AJ558305 V1.13 V1.14 V1.15 V1.16 V1.17 V1.18 V1.19 V1.20 V1.21 V1.22 V1.23 V1.24 V1.25 1 AJ558305 AJ558305 AJ558305 AJ558305 …. y así sigue. utilizando setdiff(uplr, upcrow) V166 1 NA pues menos todavia. Parece algo muy muy simple a mi entender pero no (me) sale saludos Marcos Prof. Dr. Marcos Egea Gutiérrez-Cortines Genetics, ETSIA Instituto de Biotecnología Vegetal Edificio I+D+i, Plaza del Hospital s/n Campus Muralla del Mar 30202, Cartagena Spai...
2013 Jul 23
0
setdiff y/o intersect para diferencias entre vectores
...idade Xunta de Galicia http://dxsp.sergas.es -----Mensaje original----- De: r-help-es-bounces en r-project.org [mailto:r-help-es-bounces en r-project.org] En nombre de Prof. Dr. Marcos Egea-Cortines Enviado el: jueves, 18 de julio de 2013 16:47 Para: r-help-es en r-project.org Asunto: [R-es] 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 V...
2012 Jan 15
2
determining the difference between 2 character strings
Hi, I am struggling, I have 2 lists with shared elements, one ~600, one ~1000, and I need to determine the difference between them. They are character strings, and to use setdiff(), or unique() I need vectors. I don't know how to force these character strings into a form where you can use functions like setdiff(). Any help would be greatly appreciated. > head(R1) [1] "ccc-5-96078266-C-T" "ccc-5-96127578-C-T" "ccc-5-96133900-A-G" "...
2012 Jun 27
2
a problem of approach
...8 9 (surviving vector) - number 3 generates 5 and 9 - 2 3 6 8 (surviving vector) - number 6 generates 8 - final surviving vector 2 3 6 Function foo(x, ...) generates the numbers, my current approach being: #### index <- 0 while ((index <- index + 1) < length(numbers)) { numbers <- setdiff(numbers, foo(numbers[index])) } #### This seem to take quite some time (but I don't know any other way of doing it), hence my question(s): - would there be another (quicker) implementation in R? - alternatively, should I go for a C implementation? (actually, I did create a C implementation, b...
2004 Nov 11
11
Logical "and"
Hello, I have the following very simple problem: Say I have two vectors, a<-c(1,7,4,5,9,11) b<-c(7,4,9) I would like to create a vector containing the elements in a which are not in b. Obviously, this is possible by writing a[a!=b[1] & a!=b[2] & a!=b[3]] But I would like a solution which is applicable to the situation where the number of elements in b is unknown. I have
2000 Jan 04
2
set functions
I wonder if we might also include an "equiv" function along with the other set functions (ie "union", "intersect", etc), perhaps along the lines of "equiv" <- function(x, y) all(c(match(x, y, 0)>0, match(y, x, 0)>0)) (which I think might be the quickest implementation). I use this type of function quite frequently: is there some reason why it is
2000 Jan 04
2
set functions
I wonder if we might also include an "equiv" function along with the other set functions (ie "union", "intersect", etc), perhaps along the lines of "equiv" <- function(x, y) all(c(match(x, y, 0)>0, match(y, x, 0)>0)) (which I think might be the quickest implementation). I use this type of function quite frequently: is there some reason why it is
2005 May 17
4
Combinations with two part column
Dear R-helpers, I am a beginner using R. This is the first question in this list. My question, Is there possible to make combinations with two part column? If I have a number 1,2,3,4,5,6,7,8. I need the result something like below: 1,2,3,4,5 6,7,8 1,2,3,4,7 5,6,8 2,3,4,5,6 1,7,8 1,2,3,6,7 4,5,8 1,2,3,4,8 5,6,7 3,4,6,7,8 1,2,5 .... I would be very happy if anyone could
2020 May 20
3
Feature Request: User Prompt + Message First Execution when "Managing Search Path Conflicts"
...ot;) We get the following behaviour when loading a package (Eg: dplyr): library(dplyr) ## Error: Conflicts attaching package ?dplyr?: ## ## The following objects are masked from ?package:stats?: ## ## filter, lag ## ## The following objects are masked from ?package:base?: ## ## intersect, setdiff, setequal, union So we would have to solve the conflict by writing: library(dplyr, mask.ok = c("filter", "lag", "intersect", "setdiff", "setequal", "union")) So my feature request proposal...
2012 Aug 21
2
Iterative sampling with restrictions
...d to a group to which it's already belonged). Then repeat this step until each unit has at some point been assigned to every group. More concretely, say I have 60 units and 3 groups into which to divide the units. I could first do something like: group1<-sample(1:60,20) group2<-sample(setdiff(1:60,group1),20) group3<-sample(setdiff(1:60,c(group1,group2)),20) But then how to randomly re-assign group membership such that all units are assured a different group assignment in the second "wave" of grouping? Just narrowing the sampling pool to those units that weren't previ...