similar to: Odd Behavior Out of setdiff(...) - addition of duplicate entries is not identified

Displaying 20 results from an estimated 1000 matches similar to: "Odd Behavior Out of setdiff(...) - addition of duplicate entries is not identified"

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, and a way
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, and a way
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), rownames(B)) but that is cheating. :-) I played around a
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] NA 5 NA >
2013 Feb 01
2
how to setdiff on lists of lists
Dear 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
2009 Mar 23
3
Replacing a few variable values within a DataFrame...
I would like to replace a few varaibles within a data frame. For example, in the dataframe below (contrived) I would like to replace the current housesize value only if the Location is HSV. However, I would like to leave the other values intact. I tried "ifelse", but I don't really need the else condition. test_data2_df<-data.frame(Variables=c("SQR
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>
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
2009 Oct 29
2
Recommendation for dealing with mixed input types in CSV
Currently I have a CSV with mixed input types that I am trying to read in and reformat without having to list off all the column names.? Below is an example of the data: HouseColor, HouseSize, HouseCost Blue, 1600, 160e3 Blue, 1600, 160e3 Actually I have about 60 columns like this, so imagine the above repeated about 30 times column-wise.? Luckily the ones in scientific notation are grouped
2012 Jun 25
2
setdiff datframes
hi, I have 2 files example 1 and example 2 and would like to know what is in example2 and not in example1 (attached) V1 contain data which could be in duplicated which I am using as identifiers I used setdiff(example2$V1,example1$V1) to find the identifiers which are specific to example2: [1] "rs2276598" "rs17253672" I am looking for a way to get an output with all
2013 Jul 23
0
setdiff y/o intersect para diferencias entre vectores
Hola Marcos. Yo probaría algo del estilo a esto.... Intersecc<-v1[v1%in%v2] Un saludo, _____________________________ Miguel Ángel Rodríguez Muíños Dirección Xeral de Innovación e Xestión da Saúde Pública Consellería de Sanidade 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
2009 Apr 04
1
comparing columns in a dataframe
hello, I am hoping for some advice regarding comparing variables from 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
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
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]
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
2012 Jun 27
2
a problem of approach
Dear R-help list, Part of a program I wrote seem to take a significant amount of time, therefore I am looking for an alternative approach. In order to explain what is does: - the input is a sorted vector of integer numbers - some higher numbers may be derived (using a mathematical formula) from lower numbers, therefore they should be eliminated - at the end, the vector should contain only
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) {
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