But cutree does away with the indexes from the original input, which
rect.hclust retains.
I will have no other choice and match that input with the 'values' contained
in the clusters ...
Joh
Gabor Grothendieck wrote:
> If we don't need any plotting we don't really need rect.hclust at
> all. Sp
Chris Stubben wrote:
> Also try the odiag function in the demogR package
>
> odiag( 1:5, -1)
> [,1] [,2] [,3] [,4] [,5] [,6]
> [1,]000000
> [2,]100000
> [3,]020000
> [4,]003000
> [5,]000
> "TP" == Tony Plate <[EMAIL PROTECTED]>
> on Fri, 21 Dec 2007 18:17:18 -0700 writes:
TP> Martin Maechler wrote:
>>> "MS" == Marc Schwartz <[EMAIL PROTECTED]>
>>> on Thu, 20 Dec 2007 16:33:54 -0600 writes:
>>
MS> On Thu, 2007-12-20 at 22:43 +0100, Johannes
bernardo lagos alvarez gmail.com> writes:
>
> useR's
>
> I need transform the matrix
>
> wdat
> [,1] [,2] [,3] [,4] [,5] [,6]
> [1,]010110
> [2,]100110
> [3,]000011
> [4,]110010
> [5,]1
Here's what I finally came up with. Thanks for your help!
Joh
MQUSpotOverlapClusters <- function(
Series,# Vector of data to be evaluated
distance=0.5,# Maximum distance of clustered data points
minSize=2# Minimum size of clusters returned
){
Johannes Graumann <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> But cutree does away with the indexes from the original input, which
> rect.hclust retains.
> I will have no other choice and match that input with the 'values'
> contained in the clusters ...
If you want to retain the ori
If you want indexes, i.e. 1, 2, 3, ... instead of the values in v you
can still use split -- just split on seq_along(v) instead of v (or if
v had names you might want to split along names(v)):
split(seq_along(v), ct)
and if you only want to retain groups with 2+ elements then
you can just Filter
Enlightening. Thanks.
Joh
Gabor Grothendieck wrote:
> If you want indexes, i.e. 1, 2, 3, ... instead of the values in v you
> can still use split -- just split on seq_along(v) instead of v (or if
> v had names you might want to split along names(v)):
>
> split(seq_along(v), ct)
>
> and if you
After many hours of debugging code, I came to the conclusion that I
have a fundamental misunderstanding regarding eval, and hope that
someone here can explain to me, why the following code acts as it does:
foo <- function(expr) {
eval(substitute(expr), envir=list(a=5), enclos=parent.frame()
On 22/12/2007 3:30 PM, Charilaos Skiadas wrote:
> After many hours of debugging code, I came to the conclusion that I
> have a fundamental misunderstanding regarding eval, and hope that
> someone here can explain to me, why the following code acts as it does:
>
> foo <- function(expr) {
>e
Hi everyone,
say i have a population (stable) with different amounts of animals in every
ageclass (80 of age 1, 60 of age 2, etc) in a vector.
Can anybody tell me how i can add gender (male or female) to all ageclasses?
I want a 1:1 ratio of males and females within the population (as a starting
Hi,
I have a matrix of duplicate rows. How to output a list the unique rows with
their count? I have used "unique" to have the unique rows, but can't produce
the occurences of each unique row.
Thanks
Louis
-
[[alternative HTML version de
On Dec 22, 2007, at 4:44 PM, Duncan Murdoch wrote:
>> 5) eval then creates the environment where this evaluation will
>> take place. It does that by creating an environment containing
>> the frame "a=5", and with enclosing environment the parent frame
>> of foo, which is bar's environment.
Hi Louis,
If I am understanding your question correctly, here is one way:
suppose your matrix is M of dimension n x k.
D <- data.frame(M) # convert to data frame
ones <- rep(1, n) # a column of 1s
Now you can count the number of repeats of each unique row.
aggregate( ones, by = as.list(D), F
The trackObjs package stores objects in files on disk so that files are
automatically rewritten when objects are changed, and so
that objects are accessible but do not occupy memory until
they are accessed. Also tracks times when objects are created
and modified, and caches some basic characteristi
Duncan has already pointed out that consideration of promises is
what is missing in the description but in addition the way lm and
other functions in R get around it is to use match.call like this:
bar2 <- function(er) {
mc <- match.call()
mc[[1]] <- as.name("foo")
names(mc
That's a very good idea. I'll have to see if and how it applies to
the more general case I'm dealing with. ( Essentially I am trying to
create "tkcbind" and "tkrbind" kind of functions, that group together
tcltk widgets under a new frame they create, and the frame has to be
created before
17 matches
Mail list logo