Displaying 20 results from an estimated 20000 matches similar to: "duplicates() function"
2007 Mar 08
2
Removing duplicated rows within a matrix, with missing data as wildcards
I'd like to remove duplicated rows within a matrix, with missing data
being treated as wildcards.
For example
> x <- matrix((1:3), 5, 3)
> x[4,2] = NA
> x[3,3] = NA
> x
[,1] [,2] [,3]
[1,] 1 3 2
[2,] 2 1 3
[3,] 3 2 NA
[4,] 1 NA 2
[5,] 2 1 3
I would like to obtain
[,1] [,2] [,3]
[1,] 1 3 2
[2,] 2 1 3
2008 Feb 14
1
Avoiding transferring duplicate files
Hi All,
I have a 75GB collection of data, including a lot of duplicated files,
on a NTFS network drive. I want to backup that data across a DSL link to
a Linux host. Currently I use cwrsync on a Windows machine to act as
server to the Linux rsync client.
I want to avoid transferring duplicated data, as the DSL link is a far
more significant factor than computation/disk IO. I can't work
2009 May 14
4
Duplicates and duplicated
Hi everybody.
I want to identify not only duplicate number but also the original number
that has been duplicated.
Example:
x=c(1,2,3,4,4,5,6,7,8,9)
y=duplicated(x)
rbind(x,y)
gives:
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
x 1 2 3 4 4 5 6 7 8 9
y 0 0 0 0 1 0 0 0 0 0
i.e. the second 4 [,5] is a duplicate.
What I want is
2010 Jul 05
2
to remove duplicate values
Dear R family,
Suppose I have two series.
order value
1 0.52
2 0.23
3 0.43
4 0.21
5 0.32
6 0.32
7 0.32
8 0.32
9 0.32
10 0.12
11 0.46
12 0.09
13 0.32
14 0.25
For these two series, I figured out the way to detect the locations of
duplicate values.
The next thing to do is remove the repeated values except for a value
that would not be next to each other.
In other words, while keeping the
2010 Nov 25
6
help: program efficiency
hey guys,
I am working on a function to make a duplicated value unique. For example,
the original vector would be like : a = c(2,1,1,3,3,3,4)
I'll like to transform it into:
a.nodup = 2, 1.01, 1.02, 3.01, 3.02, 3.03, 4
basically, find the duplicates and assign a unique value by adding a small
amount and keep it in order.
I come up with the following codes, but it runs slow if t is large. Is
2008 Nov 16
4
duplicate values
Hei R Users,
i have the following dataframe:
Datetime Temperature and many more collumns
1 2008-6-1 00:00:00 5
2 2008-6-1 02:00:00 5
3 2008-6-1 03:00:00 6
4 2008-6-1 03:00:00 0
5 2008-6-1 04:00:00 6
6 2008-6-1 04:00:00 0
7 2008-6-1 05:00:00 7
8 2008-6-1 06:00:00
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:
2001 Oct 31
2
removing duplicated rows from a data.frame
Dear all,
Sorry for the simplicity of the question, but how does one go about removing duplicated rows in a data.frame?
I'm looking for a quick and simple solution, as my data.frames are relatively large (50000 by 50). I've racked my brain and searched the help files and found nothing useful or quick, only duplicated() and unique() which work only work on lists.
Thanks
Gary.
2008 Jul 01
1
[.data.frame speedup
Below is a version of [.data.frame that is faster
for subscripting rows of large data frames; it avoids calling
duplicated(rows)
if there is no need to check for duplicate row names, when:
i is logical
attr(x, "dup.row.names") is not NULL (S+ compatibility)
i is numeric and negative
i is strictly increasing
"[.data.frame" <-
function (x, i, j,
2007 Mar 16
2
Duplicated non contiguous element in a list
Hello,
Given a vector I would like to rapidly identify duplicated non contiguous elements.
Given for example
c(1, 1, 2, 3, 2, 4, 5, 6, 4)
I would like to get:
FALSE FALSE TRUE FALSE TRUE TRUE FALSE FALSE TRUE
In fact I need to check this on the columns of a matrix!
I can do that of couse with loops but is there any function already available?
Thanks
2004 Sep 26
2
help for stata user
Hi,
I'm new to R, and I'm STATA user before, could you help me where I can
get document about comparison command between STATA and R.
Thank you very much,
Best regards,
-iip-
2006 Dec 05
4
has_many with :uniq not working for me
Hi all,
I have a relationship (no really!)
class RiskMatrix < ActiveRecord::Base
has_many :severities, :order => :position, :uniq => true
end
class RiskFactor < ActiveRecord::Base
belongs_to :risk_matrix
validates_presence_of :descriptor, :example
validates_uniqueness_of :descriptor, :example, :scope=> :risk_matrix_id
end
class Severity < RiskFactor
2005 Nov 16
6
nlme question
I am using the package nlme to fit a simple random effects (variance
components model)
with 3 parameters: overall mean (fixed effect), between subject
variance (random) and
within subject variance (random).
I have 16 subjects with 1-4 obs per subject.
I need a 3x3 variance-covariance matrix that includes all 3 parameters
in order to
compute the variance of a specific linear
2013 Jan 04
3
help "reshaping" dataframe
List,
I want to reshape my data, but I'm not sure how to do it... it might be a
simple task, but don't know which package does this.
"occ.data" (see below) is how my original data are arranged, and I know
that with melt() I can reshape it like "y" (see below). However, I just
want to build a matrix like the "y" matrix, but with only 2 dimensions.
Something
2012 Jul 17
2
Problem creation tensor
Hi guys,
I need some help to analyzing my data.
I start to describe my data: I have 21 matrices, every matrix on the
rows has users and on columns has items, in my case films.
Element of index (i, j) represent the rating expressed by user i about item j.
I have a matrix for each of professions.
An example of a this type of matrix is:
item 1 item 2 item 3 item4
id
2003 Nov 23
4
remove 0 rows from a data frame
Dear all,
As part of a larger function, I am randomly removing rows from a data
frame. The number of removed rows is determmined by a Poisson distribution
with a low mean. Sometimes, the random number is 0, and that's when the
problem starts:
My data frame:
> temp
occ x y dbh age
801 0 2977.196 3090.225 6 36.0
802 0 2951.892 3083.769 8 40.6
803 0 2919.111
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
2011 Mar 24
2
Questions for "domist... subscript out of bounds"
Hi all,
I am a new user for R.
I faced a questions about subscript out of bounds.
Although I checked some other helps before I sent this email, I still don't know
how to deal with this problems.
I want to use "domain" function to run species distribution model in R.
I used "sp.occ.do<-domain(env.pre, pred_train, factors=c('continent')) &
2012 May 03
1
Help with getting values from string
Hi All,
I have a doubt. I used macros and i try to pass a value to a macro by
concatenating a bunch of strings. But it does not seem to work. Please help.
I have written down my code and the error message please tell me how to pass
the value that a string points to. Thanks in advance
#macro defined
2004 Apr 28
1
simple repeated measures model: dumb user baffled!
I am in the process of transferring from an old version of S+ to using
R having used a variety of other packages in the past. I'm hugely
impressed with R but it has an excellent but depressing habit of exposing
that I'm not a professional statistician and has done so again.
Someone has run a nice little repeated measures design on my advice,
students randomised to four orders of a