Displaying 20 results from an estimated 60000 matches similar to: "Matching rows?"
2009 Mar 30
2
which rows are duplicates?
I would like to know which rows are duplicates of each other, not
simply that a row is duplicate of another row. In the following
example rows 1 and 3 are duplicates.
> x <- c(1,3,1)
> y <- c(2,4,2)
> z <- c(3,4,3)
> data <- data.frame(x,y,z)
x y z
1 1 2 3
2 3 4 4
3 1 2 3
I can't figure out how to get R to tell me that observation 1 and 3
are the same.
2009 Mar 30
2
which rows are duplicates?
I would like to know which rows are duplicates of each other, not
simply that a row is duplicate of another row. In the following
example rows 1 and 3 are duplicates.
> x <- c(1,3,1)
> y <- c(2,4,2)
> z <- c(3,4,3)
> data <- data.frame(x,y,z)
x y z
1 1 2 3
2 3 4 4
3 1 2 3
I can't figure out how to get R to tell me that observation 1 and 3
are the same.
2007 May 25
1
Speeding up resampling of rows from a large matrix
I'm trying to:
Resample with replacement pairs of distinct rows from a 120 x 65,000
matrix H of 0's and 1's. For each resampled pair sum the resulting 2
x 65,000 matrix by column:
0 1 0 1 ...
+
0 0 1 1 ...
_______
= 0 1 1 2 ...
For each column accumulate the number of 0's, 1's and 2's over the
resamples to obtain a 3 x 65,000 matrix G.
For those
2012 Jul 25
3
Select rows based on matching conditions and logical operators
Hi,
I have a dataset in which I would like to select rows based on matching
conditions and return the maximum value of a variable else return one row if
duplicate counts exist. My dataset looks like this:
PGID PTID Year Visit Count
6755 53121 2009 1 0
6755 53121 2009 2 0
6755 53121 2009 3 0
6755 53122 2008 1 0
6755 53122 2008 2 0
6755 53122 2008 3 1
6755 53122 2009 1 0
6755 53122 2009 2 1
6755
2009 Jul 02
2
matching rows in matrices
I have a matrix such as this,
[,1] [,2] [,3]
[1,] 1 1 2
[2,] 2 5 5
and a larger matrix such as this,
a b
[1,] 1 5
[2,] 2 5
[3,] 4 9
[4,] 5 8
[5,] 7 8
[6,] 7 10
[7,] 9 10
what I want to do is check the number of times the columns in the first
matrix appear as rows in the second matrix. So for instance in this example
1,5 and 2,5 appear in both so I'd want
2007 Jul 03
1
termplot - changes in defaults
While termplot is under discussion, here's another proposal. I'd like to
change the default for partial.resid to TRUE, and for smooth to
panel.smooth. I'd be surprised if those changes were to break existing
code.
John Maindonald email: john.maindonald at anu.edu.au
phone : +61 2 (6125)3473 fax : +61 2(6125)5549
Centre for Mathematics & Its Applications, Room
2007 Feb 13
2
Computing stats on common parts of multiple dataframes
Folks,
I have three dataframes storing some information about
two currency pairs, as follows:
R> a
EUR-USD NOK-SEK
1.23 1.33
1.22 1.43
1.26 1.42
1.24 1.50
1.21 1.36
1.26 1.60
1.29 1.44
1.25 1.36
1.27 1.39
1.23 1.48
1.22 1.26
1.24 1.29
1.27 1.57
1.21 1.55
1.23 1.35
1.25 1.41
1.25 1.30
1.23 1.11
1.28 1.37
1.27 1.23
R> b
EUR-USD NOK-SEK
1.23 1.22
1.21 1.36
1.28 1.61
1.23 1.34
1.21 1.22
2008 Mar 09
2
question about matrix one column values matching a vector of values
Hi,
I have a matrix
a = matrix (1:16, 4, 4)
b = c (2,3)
I want to find out which rows of a, where a[,1] equals any values of b?
I know that if b is only one value, e.g, b=2, then what I want is a[a[,1] == 2,]
But what about if it is not one value but a vector of values?
Thanks much in advance.
--
Waverley @ Palo Alto
2005 Dec 21
3
NextMethod causes R 2.2.0 to crash (PR#8416)
I found writing the following default method the for the generic
function "julian" causes R to crash.
julian.default <- function(x, ...) {
x <- as.Date(x)
NextMethod("julian", x, ...)
}
Here is a test example
> m <- as.Date("1972-09-27") + 0:10
> m
[1] "1972-09-27" "1972-09-28" "1972-09-29"
2000 Feb 23
0
Lack of Fit test
> From: "Alan T. Arnholt" <arnholt at math.appstate.edu>
> To: Bill Venables <William.Venables at cmis.CSIRO.AU>
> Cc: r-help at stat.math.ethz.ch, arnholt at math.appstate.edu
> Subject: Re: [R] Lack of Fit test
> Date: Wed, 23 Feb 2000 09:40:21 -0500 (EST)
> X-Authentication: none
>
>
> I guess my question was not adequately stated when I sent
2006 Jan 14
2
initialize expression in 'quasi' (PR#8486)
This is not so much a bug as an infelicity in the code that can easily
be fixed.
The initialize expression in the quasi family function is, (uniformly
for all links and all variance functions):
initialize <- expression({
n <- rep.int(1, nobs)
mustart <- y + 0.1 * (y == 0)
})
This is inappropriate (and often fails) for variance function
"mu(1-mu)".
2000 Feb 29
1
Congratulations on the release of 1.0.0
I see Peter has just announced the release of 1.0.0, on time,
even here in Australia, in accordance with a timetable privately
announced about 6 months ago. At that time it seemed optimistic
to put it mildly.
I am not a member of the core team, but as an ordinary user of R
with a more privileged inside view than most I'd like to offer
my personal congratulations and thanks.
This is the
2007 Jan 07
1
substitute creates an object whichprints incorrectly (PR#9427)
> I think we should get rid of source attributes completely,
> since they are no longer needed, but your comment still
> applies to source references. We should strip them when code
> gets modified.
>
> Duncan Murdoch
I would be very concerned about losing source attributes-- it would
break a lot of my code :(! It's very useful to have a single portable R
object that
2002 Aug 07
0
RE: printed copies of "An Introduction to R"
Brian,
Thanks for doing this.
As the primary author, could I have a desk copy, please?
Bill Venables.
Bill Venables,
CMIS, CSIRO Marine Laboratories,
PO Box 120, Cleveland, Qld. 4163
AUSTRALIA
Phone: +61 7 3826 7251
Fax: +61 7 3826 7304
Mobile: +61 419 634 642
<mailto: Bill.Venables at csiro.au>
http://www.cmis.csiro.au/bill.venables/
-----Original Message-----
From: Brian
2006 Mar 09
1
Trellis - setting xlim or ylim by data range in whole column or row
Dear List-mates,
I have been trying to set up a 4x8 trellis plot (that is, 4 columns, 8
rows), and would like to have the axis limits set based on the data range of
rows (for ylim) and columns (for xlim). I've been using the call:
foo<-xyplot(y~x|Epoch+Subject,
type=c("l","r"),
par.strip.text=list(cex=0.5),
...)
and updating to see different effects of scale
2000 Dec 31
3
The book: S Programming
Will the real book "S Programming" please stand up.
As I searched for this book both on AMAZON.COM and AMAZON.CO.UK, I found two
different versions.
On AMAZON.COM my search reveals
S Programming (Statistics and Computing) by Brian D. Ripley, William N.
Venables. Our Price: $59.95. Availability: Usually ships within 24 hours.
Hardcover - 264 pages 1st edition (May 15, 2000) Springer
2000 Oct 15
1
Re: I want to pull out an element from each of a list of matrices
At 18:26 14/10/00 +0100, Prof Brian D Ripley wrote:
>On Sat, 14 Oct 2000, niels Waller wrote:
>
>> Dear colleagues,
>>
>> I suspect there is a simple answer to this question -- but I cannot find
it.
>>
>> Suppose I have a list of matrices. I want to pull out an element (such as
>> row 1, col 2) from each matrix. Do I need a loop to do this? Or is
there
2002 Aug 21
0
Population dynamicist job in Queensland, Australia
My apologies for he very short time before things close, but it's not my
fault. If necessary get your hat in the ring by Friday and see to the
niceties later, may I suggest.
This is a vacancy in my group in Cleveland. The work is interesting and the
challenges large.
Bill Venables.
----------------------------------------------------------------------------
Division of Marine Research
2013 Jun 26
3
match rows of R
Hi all,
What would be an efficient way to match rows of a matrix to a vector?
ex:
m<-matrix(1:9, nrow=3)
m [,1] [,2] [,3]
[1,] 1 4 7
[2,] 2 5 8
[3,] 3 6 9
#################################
which(m==c(2,5,8)) # I want this to return 2
######################
Thanks,
Sachin
[[alternative HTML version deleted]]
2005 Apr 30
3
as.numeric method for objects of class "difftime"
I have just become painfully aware that objects of class "difftime",
generated by the difference of two POSIXct objects, carry a "units"
attribute, which flashes by when the object is printed, for example.
The pain was occasioned when I tried to turn these objects into numberic
objects for use elsewhere as a covariate.
as.numeric(difftime object)
simply turns off the units