Displaying 20 results from an estimated 60000 matches similar to: "difference between unique() and !duplicated()"
2011 Mar 09
2
Anomaly with unique and match
I stumbled onto this working on an update to coxph. The last 6 lines
below are the question, the rest create a test data set.
tmt585% R
R version 2.12.2 (2011-02-25)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-unknown-linux-gnu (64-bit)
# Lines of code from survival/tests/singtest.R
> library(survival)
Loading required package: splines
2011 May 31
2
Files are duplicated after renaming (with glusterfs+zfs-fuse)
Hi all,
I installed glusterfs (version 3.1.3) with zfs-fuse (0.6.9) as the
underlying filesystem.
After renaming a file, I found the file duplicated.
Following is my test scenario.
root at ubuntu:/# zpool create tank /dev/sdb
root at ubuntu:/# gluster volume create test-volume ubuntu:/tank/exp1
ubuntu:/exp2
root at ubuntu:/# gluster volume start test-volume
root at ubuntu:/# mount -t glusterfs
2007 Aug 28
1
subcripts on data frames (PR#9885)
I'm not sure if this is a bug, or if I'm doing something wrong.
=20
=46rom the worms dataframe, which is at in a file called worms.txt at
=20
http://www.imperial.ac.uk/bio/research/crawley/therbook
<http://www.imperial.ac.uk/bio/research/mjcraw/therbook/index.htm>=20
=20
the idea is to extract a subset of the rows, sorted in declining order
of worm density, with only the maximum
2001 Feb 06
1
AW: Proposal: Generalizing unique() and duplicated()
On Tuesday 06 February 2001 12:36, Dr. Jens Oehlschlägel wrote:
> I like the idea. Why don't you call duplicated.matrix() directly in
> unique.matrix() and duplicated.data.frame() in unique.data.frame() ?
>
> Jens Oehlschlägel
Good point. I guess I got carried away with using methods (having just gotten
the hang of the concept). :-)
Anyway, here's a corrected version:
2007 Apr 04
2
Finding a single unique item in duplicated vectors
I have a very simple problem and am completely missing
the solution.
I have two character variables (character ID's from
two datasets) Data set 'b'
is data set 'a' with one more subject added.
How do I find out which is the added subject?
I have tried duplicated and unique without much
success. I can find all the
duplicated ID's but how do I extract the new
2010 Jun 08
2
duplicated() and unique() problems
Hi everybody
I have found something (for me at least) strange with duplicated(). I will
first provide a replicable example of a certain kind of behaviour that I
find odd and then give a sample of unexpected results from my own data. I
hope someone can help me understand this.
Consider the following
# this works as expected
ex=sample(1:20, replace=TRUE)
ex
duplicated(ex)
ex=sort(ex)
ex
2015 Oct 19
3
unique index violation on objectSid on samba ad
Hi everyone,
I think, I've done something stupid here. At first I've created 2 lxc
containers and provisioned one as dc.office.mtt and joined second one to
the first ad bdc.tsnr.mtt. Then I've cloned those containers several times
and changed ip adresses and dns names of new containers to different
subnets. The name of domain stayed the same.
At first everything seemed fine, but when
2011 Feb 28
3
Problems using unique function and !duplicated
Hi, I am trying to simultaneously remove duplicate variables from two or more
variables in a small R data.frame. I am trying to reproduce the SAS
statements from a Proc Sort with Nodupkey for those familiar with SAS.
Here's my example data :
test <- read.csv("test.csv", sep=",", as.is=TRUE)
> test
date var1 var2 num1 num2
1 28/01/11 a 1 213 71
2
2003 Sep 04
1
Allelic Differentiation, sampling, unique(), duplicated()
Hi people,
I have made some progress trying to work out how to solve this problem
but I have got a bit stuck - sorry if this turns out to be a simple
exercise . .
Allelic Differentiation (AD) in genetics measures the number of
different alleles between (say) two populations eg:
Organisms in Pop 1 have alleles: a, b, c, d, e
Organisms in Pop 2 have alleles: b, b, c, d, e
Different
2010 Jul 20
1
Call to rgamma using .C causes R to hang
Hi,
I've been trying to get this working for ages, but it causes R to hang.
Here is my C code saved as test1.c
# include <R.h>
# include <Rmath.h>
void test1 (double *x, double *result)
{
result[0] = rgamma(*x, 2.0);
}
This was compiled using R CMD SHLIB test1.c & loaded in R using:
dyn.load("test1.dll")
out <-
2006 Jul 04
2
unique deletes names - intended?
Dear All,
as shown in the example, unique() deletes names of vector elements.
Is this intended?
Of course, one can use indexing by !duplicated() instead.
Greetings,
Heinz
## unique deletes names
v1 <- c(a=1, b=2, c=3, e=2, a=4)
unique(v1) # names deleted
v1[!duplicated(v1)] # names preserved
platform i386-pc-mingw32
arch i386
2008 Feb 12
6
Matching Problem
Hi
I have this vector of strings.
MyData <- c("Test1","Test2","I(Test1^2)","I(Test2^3)","I(Test1.Test2^2)")
where I want to extract only the text after "I(" and before "^" so that the
string returned only contain c("Test1","Test2","Test1.Test2")
I am not very skilled in the use of matching
2015 Nov 17
5
Cannot chown file to active directory user/group on member server
So I am still stuck. For reference here is the smb.conf on the member
server:
root at florence:~# more /etc/samba/smb.conf
[global]
netbios name = FLORENCE
security = ADS
workgroup = IOL
realm = IOL.SEAMANPAPER.COM
log file = /var/log/samba/%m.log
log level = 1
dedicated keytab file = /etc/krb5.keytab
kerberos method = secrets and keytab
2012 Aug 22
6
Duplicate definition : Merging arrays
Hello,
I am trying to create a new array by combining two other arrays. I get the
following error while running :
Duplicate definition: Print[test0] is already defined in file
/etc/puppet/manifests/test.pp at line 47; cannot redefine at
/etc/puppet/manifests/test.pp:47
My code is similar to this :
<snip>
.....
.....
$sys_server = [ ginger , test0 ]
$usr_server = [ test0, test1,
2009 Aug 12
3
listescape + shared folders with fully qualified user names
Hi,
the listescape plugin seems to take its job a little bit too serious.
Dovecot version: 1.2.3 + patch 9b62aa2132de
Without listescape:
2 list "" "*"
* LIST (\HasNoChildren) "/" "INBOX"
* LIST (\Noselect \HasChildren) "/" "#Users/test1 at merry.dovecot"
* LIST (\HasNoChildren) "/" "#Users/test1 at
2009 May 08
1
Merging two data frames with 3 common variables makes duplicated rows
I am new to R (ex SAS user) , and I cannot merge two data frames without
getting duplicated rows in the results. How to avoid this happening without
using the unique() function?
1. First data frame is called "tmv" with 6 variables and 239 rows:
> tmv[1:10,]
temps nom prenom sexe dist style
1 01:59:36 Cyr Steve H 45 free
2 02:09:55 Gosselin
2003 Sep 17
2
Transpose Data Frame Question
Hi,
I have a data.frame that has 3 columns (ID, Test, Result) and looks like this
1, Test1, 120
1, Test2, 34
2, Test1, 132
2, Test2, 28
etc
I would like to turn it around so that it looks like this
1, 120, 34
2, 132, 28
etc
I have played around some with t and reshape, but with no success.
Any suggestions or hints would be greatly appreciated.
Thanks,
Bruce
2014 Jun 24
2
[LLVMdev] Issues with clang-llvm debug info validity
+Adrian & Manman,
Looks like this is a case of non-DIRef references ending up in the IR,
and thus the references not being deduplicated. This could lead to
some of the IR bloat that you guys implemented the DIRef stuff to
reduce/avoid.
The specific issue is that the type is slightly different in the two
TUs (since the namespace scope it's contained within is different in
the two TUs -
2014 Jun 24
2
[LLVMdev] Issues with clang-llvm debug info validity
>> Without needing to change how namespaces are handled.
>>
>> Yes, using DIRefs for namespaces would cause the actual type nodes to
>> be deduplicated when they aren't even with the patch above, and that
>> would help reduce debug info metadata further if that's
>> useful/necessary.
>
> Exactly. While the above patch will cover up the problem, we
2004 May 18
2
delete duplicated from data.frame
Hi,
?unique
unique returns a vector, data frame or array like x * but with duplicate
elements removed *
what i'm doing wrong delete duplicated rows with same MEMEBRNO.
februar <- dmsegment[unique(dmsegment$MEMBERNO),]
This reduce from 197.188 rows to 184.199 but duplicated MEMBERNO didn't left
all what a Primary Key setting in mysql me say and with a fix(februar) could