Displaying 20 results from an estimated 400 matches similar to: "multiple annotations on a heatmap"
2009 Feb 12
3
getting all pairwise combinations of elements in a character string
I'm able to do this as follows, but am wondering if anyone knows a
simpler way which still avoids explicit loops?
> (mystring <- letters[1:5])
[1] "a" "b" "c" "d" "e"
> unlist(sapply(mystring[-length(mystring)],
+ function(x)
paste(x,mystring[(grep(x,mystring)+1):length(mystring)],sep="")))
a1 a2 a3
2009 Mar 17
1
breaking ties in order() based on many vectors
The order() function allows you to specify multiple vectors, which are used
successively to break ties. If I want to use many vectors to break ties
(say, 25 or more), that are columns of a matrix or elements of a list, does
anyone know a shortcut to do this without passing 25 arguments to order()?
--
Levi Waldron
post-doctoral fellow
Jurisica Lab, Ontario Cancer Institute
Division of Signaling
2009 Dec 16
1
difference between the meaning of MARGIN in sweep() and apply()
For example, subtracting 1:2 from the rows of a two-column matrix:
> t(apply(matrix(1:6,ncol=2),MARGIN=1,function(y) y - 1:2))
[,1] [,2]
[1,] 0 2
[2,] 1 3
[3,] 2 4
> sweep(matrix(1:6,ncol=2),MARGIN=2,1:2,FUN="-")
[,1] [,2]
[1,] 0 2
[2,] 1 3
[3,] 2 4
Is there a logic to this difference, or is it just a quirk of the history of
these
2009 Aug 27
2
setting par(srt) according to plot aspect ratio
How can I look up the aspect ratio of a plot, so I can use that to correctly
adjust the angle of text which is supposed to be parallel to a line in the
plot?
The following example code works for a 1:1 aspect ratio, but puts the text
at the wrong angle if the plot region is short and wide or tall and narrow.
I can't find a par() component containing the plot aspect ratio. It will
be for
2009 Aug 31
3
Two way joining vs heatmap
Hi
STATISTICA has a function called "Two-way joining" (see
http://www.statsoft.com/TEXTBOOK/stcluan.html#twotwo) and the
reference material states that this is based on the method as
published by Hartigan (found this paper:
http://www.jstor.org/pss/2284710 through wikipedia).
What is the relationship (if any) between the "heatmap" function in R
and this technique? Is there an
2010 Feb 23
2
heatmap.3
Hello again,
lately I have been playing a lot with heatmap functions,
in particular I complemented heatmap.2 with a nice feature from
heatmap.plus,
i.e. the possibility of assigning a matrix to ColSideColors so to take into
account more annotations.
Below is the code I introduced in heatmap.2, everything else is maintained
equal to heatmap.2:
if (!missing(ColSideColors)) {
#if
2009 Feb 12
3
Looping multiple output values to dataframe
Dear R users,
I have various vector geometry operations to perform on 3-D coordinate data
located on multiple (500+) csv files. The code I have written for the
calculations works just fine. I have written a 'for' loop to automate the
task of extracting the coordinates from the files and perform the analyses.
The loop works reasonable well, but if the number of csv files is greater
than
2011 Jun 09
1
a bug in heatmap.plus?
Hi Allen and list,
See the code below.? I've tried it on R2.13 and R2.8.0 using either heatmap.plus 1.3 or the latest.? All gave the same results.? The problem is in the last line: when I tried to plot two different color bars, the one corresponding to "cm.colors(10)" is not correct (it starts with one black and one red.? Not sure where they're from?)
Any ideas?
Thanks!
2012 Feb 28
1
Unexpected behaviour for RowSideColors in function heatmap
Hello,
I have come across some unexpected behaviour of the function heatmap in the stats package. This looks like a bug to me, but I might have misunderstood something.
When calling the function in symmetric mode, the ColSideColors are plotted correctly, but RowSideColors appear in reverse order. This code (modified from the example on the help page) demonstrates the problem:
cU <-
2011 Sep 21
1
Making ?source act as if it is run through the terminal
Hello dear R help,
The motivation for my question is wanting to run HTMLStart {R2HTML package}
from "source".
*Background:*
I was happy to discover the [ HTMLStart/HTMLStop, HTMLplot] functions in the
R2HTML package.
They allow my R code to run almost as is, but while writing most of the
output (including the figures, when using HTMLplot) into an external HTML
file.
This method
2008 Dec 31
3
Paste in a FOR loop
Hi All,
I've been having a little trouble using R2HTML and a loop, but can't figure
out where the problem lies, any hints gratefully received.
My code at the minute, (Which does work) is in the following:
library(R2HTML)
HTMLStart(outdir =
file.path("C://Example_work","R_projects","Dynamic_creative"),filename =
"RMDC_mockup",Title="Mock up for
2007 Sep 05
1
problem formatting and positioning title in heatmap
I am using heatmap with the arguments below. The title size stays the
same no matter what I set cex.main to. Is this expected? Can I adjust
the title size in heatmap?
Also, the position of the main title is at the very upper edge of the
output and if I use a "\n" to stack the title the upper line is out of
bounds and doesn't show up.
I am outputting to pdf.
Any help? Thanks,
2010 Jun 05
2
R2HTML problem
Im developing an application with R and Gtk+. It's just a simple GUI which
helps new users to interactuate with R. Thing is, when you do a statistical
analysis, I also want to provide a HTML report, but HTMLStart doesnt work
propperly when executing from TinnR. It does create the file but not empty,
I've tried some examples from different websites, and it's always the same..
it works
2010 Mar 16
1
heatmap.2 - ColSideColors question
Hi,
I wanted to make more than one side color bar. For example, I can make one side color bar (col1) with the following code:
-----------------------------------
library(gplots)
mat <- matrix(sample(1:100,40),nrow=5)
class1 <- c(rep(0,4),rep(1,4))
col1 <- ifelse(class1 == 0,"blue","red")
class2 <- c(rep(1,3),rep(2,5))
col2 <- ifelse(class2 ==
2009 Feb 27
0
Mutiple ColSideColors for heatmap.2
I am in a situation needing 3 ColSideColors for heatmap.2. How can I do that?
TIA
Daren
2011 Sep 21
0
heatmap.2 with colsep and sepwidth
I am using attributes colsep and sepwidth from heatmap.2 function,
however when using larger values for sepwidth the following columns are
not moved to the right but the seperator is covering the column(s) with
a white bar and the column labels and ColSideColors remain at their
positions, is this intended? I expected the following columns to be
shifted to the right by sepwidth. Is there a way
2008 Sep 23
2
R2HTML: output from for-loops
Hi,
I am trying to prepare a report with R2HTML using
HTMLStart(outdir="./html", filename="report", echo=T, HTMLframe=F)
then, for instance, I want to get the output of a loop:
for (i in 1:20) print(summary(rnorm(1000)))
but only the first of summaries really ends up in the html file.
What am I doing wrongly?
Thanks,
Werner
2003 Mar 31
2
Using R2HTML
Hello,
I''m using R2HTML library to make a HTML page output (both data frames and
graphics):
HTMLStart(outdir=paste(getwd(),"/prove html", sep = ""),filename="index",
echo = F, HTMLframe = T, withprompt = "HTML> ", CSSFile = "R2HTML.CSS",
Title = "Indici di attivit?")
...
2009 Aug 19
1
moving color key in heatmap
Dear list,
I have a question on moving color keys when side color bars are added to a heatmap.
The R code below produces the color key in the upper left corner. Notice I have added side bars to the heatmap, but how could I move the color key below the image?
------
library(gplots)
data(mtcars)
x <- as.matrix(mtcars)
rc <- rainbow(nrow(x), start=0, end=.3)
cc <- rainbow(ncol(x),
2010 Jan 03
3
R2HTML Report number format, or Better Way?
Here I am again with question I'll feel foolish for asking, when I
see the answer.
I'm trying to produce a report and here's where I get stuck:
How do I get R2HTML to produce the same number format?
Particularly remove the decimal places for Par and Sal.
Are there better methods to produce this type of report?
Thanks,
L.A.
R version 2.10.0 XP