Displaying 20 results from an estimated 2000 matches similar to: "[PATCH] Typo in 'unique' help page (PR#11401)"
2011 Oct 05
1
unique possible bug
Hi,
I am trying to read in a rather large list of transactions using the
arules library. It seems in the coerce method into the dgCmatrix, it
somewhere calls unique. Unique.c throws an error when n > 536870912;
however, when 4*n was modified to 2*n in 2004, the overflow protection
should have changed from 2^29 to 2^30, right? If so, how would I
change it in my copy? Do I have to recompile
2013 Oct 30
1
unique(1:3,nmax=1) freezes R
Dear all,
I was playing around with factor contrasts, and found the argument nmax on function factor. When using nmax=1, R froze completely, and I had to close it from task manager. After some debugging, I found that the problem is actually in unique-function, where the internal unique function is called:
.Internal(unique(x, incomparables, fromLast, nmax))
More generally, it looks like
2010 Jan 16
2
Extracing only Unique Rows based on only 1 Column
To Whomever is Interested,
I have spent several days searching the web, help files, the R wiki
and the archives of this mailing list for a solution to this problem,
but nonetheless I apologize in advance if I have missed something
obvious.
The problem is this; I have a 5-column data frame with about 4.2
million rows, and want to create a new (and hopefully much smaller)
data frame that
2007 Nov 02
0
applying duplicated, unique and match to lists?
Dear R developers,
While improving duplicated.array() and friends and developing equivalents for the new ff package for large datasets I came across two questions:
1) is it safe to use duplicated.default(), unique.default() and match() on arbitrary lists? If so, we can speed up duplicated.array and friends considerably by using list() instead of paste(collapse="\r")
2) while
2012 Sep 27
3
Keep rows in a dataset if one value in a column is duplicated
Hi,
I have a data set of observations by either one person or a pair of people.
I want to only keep the pair observations, and was using the code below
until it gave me the error " $ operator is invalid for atomic vectors". I am
just beginning to learn R, so I apologize if the code is really rough.
Basically I want to keep all the rows in the data set for which the value of
2010 Feb 05
1
unique function works funny
I have 3 nested functions, the core function goes like this:
listx<-function(x,tox)
{
xt=table(x)
wa=sort(unique(x,fromLast=FALSE))
print(xt)
print(wa)
......
return(kk)
}
listx get called in functionB, and functionB get called in functionC.
When I test functionB, the listx function works just fine. When I call
functionB from functionC, strange thing happened:
My result for xt:
0.07 0.17
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
2009 Mar 30
1
duplicated fails to rise correct errors (PR#13632)
Full_Name: Wacek Kusnierczyk
Version: 2.8.0 and 2.10.0 r48242
OS: Ubuntu 8.04 Linux 32 bit
Submission from: (NULL) (129.241.110.161)
In the following code:
duplicated(data.frame(), incomparables=NA)
# Error in if (!is.logical(incomparables) || incomparables)
.NotYetUsed("incomparables != FALSE") :
# missing value where TRUE/FALSE needed
the raised error is clearly not the
2008 Sep 12
1
match and incomparables
Hello,
I was playing around with the newly implemented 'incomparables' argument
in 'match' and realized the argument does not behave anything like I
expected. Can someone explain what is going on here? Sorry if I'm
misreading the documentation.
> match(1:3, 1:3, incomparables=1)
[1] NA 2 3 # This seems right, the 1 in 'x' is 'incomparable'
>
2012 Jul 23
1
duplicated() variation that goes both ways to capture all duplicates
Dear all
The trouble with the current duplicated() function in is that it can
report duplicates while searching fromFirst _or_ fromLast, but not
both ways. Often users will want to identify and extract all the
copies of the item that has duplicates, not only the duplicates
themselves.
To take the example from the man page:
> data(iris)
> iris[duplicated(iris), ] ##duplicates while
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:
***
2010 Jun 29
2
POSIXlt matching bug
I came across the below mis-feature/bug using match with POSIXlt objects
(from strptime) in R 2.11.1 (though this appears to be an old issue).
> x <- as.POSIXlt(Sys.Date())
> table <- as.POSIXlt(Sys.Date()+0:5)
> length(x)
[1] 1
> x %in% table # I expect TRUE
[1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
> match(x, table) # I expect 1
[1] NA NA NA NA NA NA NA NA
2015 Jan 23
1
:: and ::: as .Primitives?
Hi,
On 01/23/2015 07:01 AM, luke-tierney at uiowa.edu wrote:
> On Thu, 22 Jan 2015, Michael Lawrence wrote:
>
>> On Thu, Jan 22, 2015 at 11:44 AM, <luke-tierney at uiowa.edu> wrote:
>>>
>>> For default methods there ought to be a way to create those so the
>>> default method is computed at creation or load time and stored in an
>>>
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)
2011 Jan 20
6
Identify duplicate numbers and to increase a value
Hi everybody.
I want to identify duplicate numbers and to increase a value of 0.01 for each time that it is duplicated.
Example:
x=c(1,2,3,5,6,2,8,9,2,2)
I want to do this:
1
2 + 0.01
3
5
6
2 + 0.02
8
9
2 + 0.03
2 + 0.04
I am trying to get something like this:
1
2.01
3
5
6
2.02
8
9
2.03
2.04
Actually I just know the way to identify the duplicated numbers
rbind(x, duplicated(x) |
2016 Jun 08
1
Trivial patch for merge.Rd
Hi all,
After replying to r-help earlier today on the merge() related thread, I noted a trivial grammatical error in the description for the 'suffixes' argument in it's help file.
A patch against the current SVN trunk version of merge.Rd in ..library/base/man is attached and pasted here:
--- merge1.Rd 2016-06-08 13:34:35.000000000 -0500
+++ merge2.Rd 2016-06-08 14:03:34.000000000
2008 Nov 24
1
timezone attribute lost
Hi,
As I didn't get any response on the general help list and I don't know
if there is a bug in action I am trying my luck here.
I was highly surprised to find out that during simple operations (see
code below) the timezone attribute for POSIXct data is lost and then,
upon the next interpretation, the system settings are used (which are
plain wrong in my case).
I have used R 2.8.0
2012 Jan 17
1
arguments in merge() not accepted
dear r-listers,
this may be some rally stupid mistake, but googling didn't help me any further:
> merge(data1, data2, all.x=T)
gives back:
:?Error in merge(data1, data2, all.x = T) :
: unused argument(s) (all.x = T)
[same with any other argument i try to put in..]
although the man page states
>merge(x, y, by = intersect(names(x), names(y)),
> by.x = by, by.y = by, all =
2013 Mar 18
2
data.frame with NA
I have this little data.frame
http://dl.dropbox.com/u/102669/nanotna.rdata
Two column contains NA, so the best thing to do is use na.locf function (with
fromLast = T)
But locf function doesn't work because NA in my data.frame are not recognized as
real NA.
Is there a way to substitute fake NA with real NA? In this case na.locf function
should work
Thank you
2011 Dec 15
1
R CMD check fails to warn about undocumented classes and methods
In
> R.version.string
[1] "R Under development (unstable) (2011-12-15 r57901)"
PkgA promotes 'unique' to a generic and exports that
DESCRIPTION:
Imports: methods
R/f.R:
setGeneric("unique")
NAMESPACE:
export(unique)
and PkgB creates and exports a method on unique
DESCRIPTION
Imports: methods, PkgA
R/f.R:
setClass("B",