Displaying 20 results from an estimated 3000 matches similar to: "Help transforming a dist"
2011 Dec 26
1
Finding all triangles in a graph
I have the adjacency matrix of a graph. I'm trying to find all
triangles (embeddings of C_3). This doesn't work:
index = function(l) seq(l)[l]
pairs = do.call(rbind, lapply(seq(nrow(adj)), function(x) cbind(x,
index(adj[x,]))))
triangles = do.call(rbind, apply(pairs, 1, function(x) cbind(x,
index(adj[x[1],] & adj[x[2],]))))
I'm absolutely certain I've gone down the wrong path
2011 Jul 26
3
[LLVMdev] Spills and values present in both registers & stack
One piece of code I'm writing has a lot of intermediates, and I'm
trying to optimize down the number of memory accesses. Here's a
snippet from the start of the function, where I think there is some
low-hanging fruit:
# BB#0:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rcx
movq %rdi, -16(%rsp) # 8-byte Spill
movq (%rsi), %rdi
movq
2011 Jul 28
0
[LLVMdev] Spills and values present in both registers & stack
On Tue, Jul 26, 2011 at 11:35 AM, Taral <taralx at gmail.com> wrote:
>
> One piece of code I'm writing has a lot of intermediates, and I'm
> trying to optimize down the number of memory accesses. Here's a
> snippet from the start of the function, where I think there is some
> low-hanging fruit:
>
> # BB#0:
> pushq %rbp
> pushq %r15
2011 Aug 02
0
[LLVMdev] clang: Manual unfolding doesn't match automatic unfolding
Here's the code and compilation steps:
#include <stdint.h>
typedef unsigned int uint128_t __attribute__((mode(TI)));
typedef struct{
uint64_t l[5];
} s;
void f(s * restrict r, const s * restrict x, const s * restrict y) {
uint128_t t[5] = {0, 0, 0, 0, 0};
#define BODY(i,j) { int i_ = i < j ? i : j; int j_ = i < j ? j :
i; uint128_t m = (uint128_t) x->l[i_] *
2009 Mar 03
2
preparing data for barplot()
What is the best way to produce a barplot from my data? I would like
the barplot to show each person with the values stacked
val1+val2+val3, so there is one bar for each person When I use
barplot(data.matrix(realdata)), it shows one bar for each value
instead.
To post here, I created an artificical data set, but it works fine.
fakedata <- as.data.frame(list(LETTERS[1:3]))
colnames(fakedata)
2010 Dec 07
1
please show me simple example how to plot "Distance-Weighted Least Squares" fitting
I got simple x,y pairs of data and simple scatterplot and just cannot figure
how to do it , there are many examples but always there is error popping out
please show me an example stripped with additional data just core of what I
need to do to get this damn line
--
View this message in context:
2012 Dec 07
2
Converting character to numeric: Error: (list) object cannot be coerced to type 'double'
Dear R users,
I am facing a pretty a unusual problem while converting character to
numeric. Any input would be appreciated.
Below is the code and error faced:
---------------------------------------
*> str(cmie.dts)*
*'data.frame': 4397 obs. of 1 variable:*
* $ INE001A01036: chr "1482181740.000000" "1482181740.000000"
"1482181740.000000"
2012 Dec 11
1
converting manual command to loop command
Dear useRs,
i have certain commands for some operations in R. They are good if you have a small dataset but my dataset, apart from what i used in the recent past, is prety large. I want to convert these massive sets of commands into a simple loop.
Your help is required on it
thanks in advance
eliza
kindly note:
"e" is matrix whose each column has to be executed into a distance vector
2000 Sep 11
4
longs
Please change all longs to int, and never use them in the future :)
They arent needed as on most platforms they are the same size. (which is the assumption made in the ogg code anyway)
The reason for this is i will have vorbis support on playstation 2, but long is 64 bits, and they are excruciatingly slow.
cheers
Brett Paterson
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg
2012 Feb 17
5
How to change the order of columns in a data frame?
Dear all,
I have a data frame in which the columns need to be ordered. The first column X is at the right position, but the remaining columns X1-Xn should be ordered like this: X1, X2, X3 etc instead of like below.
> colnames(pos1)
[1] "X" "X1" "X10" "X11" "X12" "X13" "X14" "X15" "X16"
2009 Jul 23
4
remove multiple columns by name from dataframe
Hi there,
I'm trying to remove multiple columns by name from a data.frame. As a
result I need to get back the modified data.frame without the removed
columns. My columns I want to delete are listed in a vector called
"delete".
data <- read.csv2("data.csv")
delete <- c("col1", "col2", "col3")
newData <- subset(data, select =
2011 Oct 03
1
Assigning factor names to interaction plot
Hi everyone,
I have the following problem:
I have three variables, 'group', 'city' and 'pressure'
There is an interaction effect between group and city and I'd like to show
this in an interaction plot:
interaction.plot(group, city, pressure, type="b",
col= c(1:2),
leg.bty="o", leg.bg="blue", lwd=1,
2000 Aug 29
5
Optimization and doubles vs. floats
I saw some mail go by a bit ago about doubles-vs-floats, but I seem to have lost it.
I'm interested in rewriting the mdct code using Altivec on MacOS X. Altivec doesn't support doubles, though -- the only floating point vector type is single precision floats. Vorbis currently has doubles everywhere -- is this really necessary? Doubles are supposedly faster than floats in the PPC
2011 Jan 20
2
ANOVA plotting
Dear List,
I recently started using R and I have a simple question. I am running R (v.
2.12.1) and Rcmdr (v.1-6.3) on Mac (Snow Leopard).
I am using a data set I used before for practicing ANOVA with R, so I know
what the results should look like. I can get ANOVA table using both Rcmdr
and GUI. However, I cannot make R prepare the ANOVA diagram (with boxplots,
showing the data points, including
2010 Mar 26
2
More efficient alternative to combn()?
Hi,
i am working on a problem where i need to compute the products of all
possible combinations of size m of the elements of a vector. I know that
this can be achieved using the function combn(), e.g.:
> vector <- 1:6
> combn(x = vector, m = 3, FUN = function(y) prod(y))
In my case the vector has 2000 elements and i need to compute the values
specified above for m = 32. Using combn() i
2005 Jan 17
1
Time line plot in R?
Dear R users,
In order to illustrate the possible effects of events on variables
plotted against time, I would like plot a time line of events along side
the plot of the variables.
The x-axis should be some time unit; the y-axis should be the variable
of interest; the time line should be plotted below the graph along the
same x-axis scale.
As I have many variables and different events
2012 Nov 21
6
Scaling values 0-255 -> -1 , 1 - how can this be done?
I have a dataframe in which I have values 0-255, I wish to transpose them such that:
if value > 127.5 value = 1
if value < 127.5 value = -1
I did something similar using the "binarize" function of the biclust package, this transforms my dataframe to 0 and 1 values, but I wish
to use -1 and 1 and looking for a way in R to do this.
Brian
2007 Apr 10
1
R CMD Rdconv drops sections: arguments, seealso, examples (PR#9606)
I've created a .Rd file (below), then converted that to .sgml using
R CMD Rdconv --type=Ssgm combn.Rd > combn.sgml
The output (shown below) is missing some of the sections:
arguments
seealso
examples
If instead I convert to .d (below), the same sections are missing,
and the "note" section is included but without the necessary newline.
2010 Nov 17
1
efficient conversion of matrix column rows to list elements
Hi List,
I'm hoping to get opinions for enhancing the efficiency of the following
code designed to take a vector of probabilities (outcomes) and calculate a
union of the probability space. As part of the union calculation, combn()
must be used, which returns a matrix, and the parallelized version of
lapply() provided in the multicore package requires a list. I've found that
2009 Aug 12
3
Combinatorial problem
I have been struggling trying to write some code to produce all
combinations subject to some restrictions. I thought someone might have
some bright ideas.
I have 11 values which fall into 5 groups. I want all combinations of
2,3, and 4 values where each value must be from a different group. The
numbers in the groups are different. Here is a definition of the groups:
groups <- list(gp1 =