Displaying 20 results from an estimated 11329 matches for "uniquely".
2012 Jun 28
2
Aggregate weights for a unique set of rows
Hi, all together. I have - a maybe trivial - problem with aggregating a
list of weights.
Here is the problem:
- At first I have set of nodes (X/Y-coordinates) and associated weights,
where the set
of nodes is typically not unique
- I want to get a set of unique nodes and the sum of associated weights
I am grateful for any help
See for example:
# weights:
w <- c(1, 1, 1, 1, 1)
#
2014 Dec 27
1
[Bug 87775] New: [ALL] WARNING: value %x not uniquely defined
https://bugs.freedesktop.org/show_bug.cgi?id=87775
Bug ID: 87775
Summary: [ALL] WARNING: value %x not uniquely defined
Product: Mesa
Version: git
Hardware: Other
OS: All
Status: NEW
Severity: normal
Priority: medium
Component: Drivers/DRI/nouveau
Assignee: nouveau at lists.freedesktop.org
Reporter: i...
2011 Dec 15
1
S4 NAMESPACE method imports and exports do not include (promoted?) generics
In
> R.version.string
[1] "R Under development (unstable) (2011-12-15 r57901)"
section 1.6.6 of 'Writing R Extensions' says
Note that exporting methods on a generic in the namespace will
also export the generic, and exporting a generic in the
namespace will also export its methods.
and
Note that importMethodsFrom will also import any generics defined in
2004 Jun 29
1
RE: [S] Different behaviour of unique(), R vs. Splus.
The source of the incompatibility:
In S-PLUS 6.2:
> methods("unique")
splus splus menu splus
"unique.data.frame" "unique.default" "unique.name" "unique.rowcol.names"
In R-1.9.1:
> methods("unique")
[1] unique.array unique.data.frame unique.default unique.matrix
2008 Dec 05
1
Yet another set of codes to optimize
I have problems converting my dataset from long to wide format. Previous attempts using reshape package and aggregate function were unsuccessful as they took too long. Apparently, my simplified solution also lasted as long.
My complete codes is given below. When sample.size = 10000, the execution takes about 20 seconds. But sample.size = 100000 seems to take eternity. My actual sample.size is
2010 Jan 26
1
splitting a factor column into binary columns for each factor
Yesterday I posted the following question (my apologies for not putting a subject line):
=================question======================
Hello -- I would like to know of a more efficient way of writing the following piece of code. Thanks.
options(stringsAsFactors=FALSE)
orig <- c(rep('11111111',100000),rep('22222222',200000),rep('33333333'
2012 Dec 27
4
Finding (swapped) repetitions of numbers pairs across two columns
Hi,
I've had this problem for a while and tackled it is a quite dirty way
so I'm wondering is a better solution exists:
If we have two vectors:
v1 = c(0,1,2,3,4)
v2 = c(5,3,2,1,0)
How to remove one instance of the "3,1" / "1,3" double?
At the moment I'm using the following solution, which is quite horrible:
v1 = c(0,1,2,3,4)
v2 = c(5,3,2,1,0)
ft <-
2005 Aug 22
2
Symbols as Parameters
Hey all,
I''ve been staring at the pickaxe, experimenting, and looking through
some of the Rails API but I can''t put this simple thing together. I
want to create a method that can have zero or more parameters and some
of those are symbols. A very simple example would look something like this:
find(options = {})
if options[:unique]
puts ''Do the unique
2018 Jul 02
1
MARGIN in base::unique.matrix() and base::unique.array()
Hi,
The man page for base::unique.matrix() and base::unique.array() says
that MARGIN is expected to be a single integer. OTOH the code in charge
of checking the user supplied MARGIN is:
if (length(MARGIN) > ndim || any(MARGIN > ndim))
stop(gettextf("MARGIN = %d is invalid for dim = %d",
MARGIN, dx), domain = NA)
which doesn't really make sense.
As
2010 Jun 13
5
Count of unique factors within another factor
I have a data frame with two factors (sampling 'unit', 'species'). I want to
calculate the number of unique 'species' per 'unit.' I can calculate the
number of unique values for each variable separately, but can't get a count
for each ?unit?.
> data=read.csv("C:/Desktop/sr_sort_practice.csv")
> attach(data)
> data[1:10,]
unit species
1
2012 Aug 28
5
return first index for each unique value in a vector
I would like to efficiently find the first index of each unique value in a
very large vector.
For example, if I have a vector
A<-c(9,2,9,5)
I would like to return not only the unique values (2,5,9) but also their
first indices (2,4,1).
I tried using a for loop with which(A==unique(A)[i])[1] to find the first
index of each unique value but it is very slow.
What I am trying to do is easily
2009 Jun 29
2
How to select partially (not completely) unique rows?
Dear R-helpers,
I know how to use unique to select unique rows, e.g.
unique.rows<-unique(dataframe)
but I would like to select those rows that are unique only only TWO of my
dataframe's columns (so, two rows with the same value on these two columns
would not be kept, even if they had different values in other columns).
For example, I have a dataframe with 10 columns, two of which are
2005 Jan 29
3
unique rows
Dear list,
I would like to extract from a matrix all those rows, that are unique.
By unique, I don't mean the unique that is accomplished by the function
unique(), though...
Consider the following example:
> h
[,1] [,2]
[1,] 4 4
[2,] 1 4
[3,] 4 1
Now unique(h) returns exactly the same - because 1 4 and 4 1 is not the
same for that function.
What I would like to
2006 Apr 20
2
Count Unique Rows/Values
Hi,
I have a dataset which has both numeric and character values with dupllicates. For example:
155 A
138 A
138 B
126 C
126 D
123 A
103 A
103 B
143 D
111 C
111 D
156 C
How can I count the number of unqiue entries without counting duplicate entries. Also can I extract the list in a object. What I mean is
Col1 unique count = 8 Unique Elements are :
2004 Aug 19
0
suggesting a new feature for unique()
Dear R-devel,
May I suggest that a new feature be added to a couple of unique() methods?
Sometimes it's useful to have the indices of the original data that the
unique elements come from, so that the original data can be recreated from
the unique()ed data. I suggest that an `index' argument be added for
unique. Below is a suggested patch against
R/src/library/base/R/duplicated.R:
***
2009 Feb 22
4
'unique' error message is printed despite silent=TRUE (PR#13547)
In 2.8.0/Windows Vista:
When 'unique' gives a type error message, it prints out even if errors
are being caught:
> try(unique(quote(hello)),silent=TRUE)
hello
This comes from the .Internal unique routine:
> try(.Internal(unique(quote(hello),NULL,NULL)),silent=TRUE)
hello
I guess it is using the internal equivalent of print rather than the
internal equivalent of stop.
2007 Sep 13
3
difference between unique() and !duplicated()
Yesterday I spend the whole day struggling on how to get
the maximum value of "y" for every unique value of "x"
from the dataframe "test". In the R Book (Crawley, 2007)
an example of this can be found on page 121. I tried to do
it this way, but I failed.
In the end, I figured out how to get it working (first
order, and afterwards use !duplicated()). My question
2012 Dec 08
1
namespace S3 and S4 generic imports cannot both be satisfied:
PkgA wishes to write a method for 'unique' on S4 class 'A'. ?Methods indicates
that one should
setGeneric("unique")
setClass("A")
unique.A <- function(x, incomparables=FALSE, ...) {}
setMethod(unique, "A", unique.A)
Both S3 and S4 methods need to be exported in the NAMESPACE
import(methods)
S3method(unique, A)
2004 Sep 01
3
Unique lists from a list
Hi
I have a list. Two of the elements of this list are "Name" and
"Address", both of which are character vectors. Name and Address are
linked, so that the same "Name" always associates with the same
"Address".
What I want to do is pull out the unique values, as a new list of the
same format (ie two elements of character vectors). Now I've worked out
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