Displaying 20 results from an estimated 10000 matches similar to: "Assigning colors to cells"
2011 Jul 29
2
problems with image.plot()
Hi all,
I used image.plot() to create a heat map of a matrix:
as.matrix(read.table("Matrix.txt", sep="\t"))->x
HeatBrk<-seq(5,25,2.5)
MyCol= gray((7:0)/7)
library(fields)
image.plot(x, col=MyCol, breaks=HeatBrk, legend.shrink=0.3)
dev.copy(device=pdf, file="HEAT4!.pdf", height=8, width=8)
dev.off()
There are a few things that I would like to do that I
2011 Dec 06
1
Unable to collate and parse R files with R CMD check
Hi all,
I'm trying to build a package on Windows 7 (64 bit) and although R cmd
build worked fine and I got pkg.tar.gz with no errors, but when I tried
doing R CMD check everything turns out ok except for the warning:
"checking whether package 'pkg' can be installed ... ERROR.
Installation failed."
It then refers me to the error file "00install.out" which reads as
2012 Feb 14
4
Color cells of a matrix as in Excel
All,
I frequently make spreadsheets in Excel in which I rank values in columns
by stop-light colors (red is bad, yellow is OK, green is good).
Image and heatmap expect a matrix in which all the data are in the same
scale, but I frequently have different scales in different columns. ie.
Column one runs from 1-10 while column 2 runs from 1-100. I thus need to
define a separate color ramp for each
2011 Aug 25
2
axes start at end of plot
Hello all, I used the following script to generate a plot, but when I
try to place axes, the axes start at the end of my plot and continue off
the plot; the attached image shows what happens when I try to generate
axes.
library(fields)
as.matrix(read.table("Matrix.txt", sep="\t"))->x
#the matrix is a square matrix measuring 104x104; it was too large to attach
#on left:
2005 Jul 27
3
Asymmetric colors for heatmap
> Dear expeRts,
>
> Currently, my colors are as follows:
> mycol <-
> c("blue1","blue2","blue3","blue4","black","yellow4","yellow3","yellow2","y
> ellow1")
> heatmap(snp, Rowv=NA, Colv=NA, col=mycol)
>
> However, I would like to have the following colors:
> bright blue ->
2010 Feb 07
3
specifying colors in a heatmap/image -like plot
Hi,
I have searched for a solution but I failed to find an answer. I am hoping
you may be able to help me.
I have a data set where I have observations for a number of units (n =~40)
over a period of time (t =~100) and I have a variable (Z) that codes a
categorical variable for each observation. I want to produce a 2D plot where
time is on the x-axis and units are on the y-axis. Then each block
2010 Oct 08
2
Heatmap/Color Selection(Key)
Hi
I made heatmap of QTL based on Lod score. Where I have traits in columns and
marker data (rows). I can not cluster both column and rows as I need the
right order for marker data.
Can someone suggest me better way of generating heatmaps especially the
colour key I want to select to visualize the results which are more
interesting to look at.
> library(gplots)
>
2007 Feb 09
2
heatmap color specification
hi,
I have a positive integer matrix like:
test<-matrix(c(1,2,2,2,2,1,1,2,3),3)
and based on the distant function I made like this:
generateDistMat<-function (target)
{
n <- nrow(target)
rn <- rownames(target)
distM <- matrix(NA, n, n)
diag(distM) <- 0
for (i in 1:(n - 1)) for (j in (i + 1):n) {
distM[i, j] <- length(which(target[i, ] !=
2009 Sep 21
1
Specific criteria for color palette using heatmap.2
I'm trying to display the probability space of a function and wanted to see
specifically where the maximum posterior probability is.
data=read.table("PosteriorData",header=F)
mat=as.matrix(data)
heatmap.2(mat/max(mat,na.rm=T),dendrogram=c("none"),trace=c("none"),
Rowv=F,Colv=F,labRow=3*c(10:-10),labCol=3*c(-10:10),symm=T,col=rainbow(100))
As the
2009 Apr 07
2
heatmap.2 no reordering of the columns and rows
Hi,
I need to generate a heatmap on a square matrix and wouldn't want to reorder the columns and the rows on the heatmap display.
I have used the options Rowv=NULL and Colv=NULL but doesn't seem to work. Following is a snippet of the heatmap function i am using.
args <- commandArgs();
inputfile <- args[2]
imgfile <- args[3]
bitmap(imgfile, height=15, width=15, res=100,
2008 May 28
1
heatmap-changing column or row names
Dear R Community,
I am trying to create an heatmap for the following set of data:
##example of data matrix
o4
V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18
green 27 28 29 29 28 28 26 25 25 23 23 22 22 21 21 22 22 22
yellow 6 8 8 7 7 7 6 6 6 7 7 7 6 6 6 6 6 5
red 15 15 15 15 15 15 14 13 12 11 12 10 9 8 7 6 8 9
pink
2010 May 31
2
about heatmap
Hi all:
As to the "heatmap" function, the default style is "red and yellow",and red refers to low level and yellow refers to high level.
How can I change the style to the contrary: red refers to high level and yellow refers to low level?
Thanks a lot!
My best
[[alternative HTML version deleted]]
2013 Feb 20
1
Problem with levelplot() in a loop
Dear R users,
I am trying to print heatmaps in a loop (with a pause). Idea is to
visualize changing correlations over time and for testing I wrote this
simple (reproducible) code below.
My problem is that levelplot() does not produce any output when I run the
code (though heatmap does). Ideally I would like to use levelplot() as it
produces a neat index on the side indicating the color and the
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 Jan 26
2
heatmap with levelplot
Hi there,
I'd like to create a heatmap from my matrix with
a) a defined color range (lets say from yellow to red)
b) using striking colors above and below a certain threshold (above = "green",
below = "blue")
Example matrix (there should be a few outliers generated...) + simple levelplot
without outliers marked:
library(lattice)
my.mat <- matrix(rnorm(800), nrow =
2009 Mar 13
5
Selecting / creating unique colours for behavioural / transitional data
Dear all,
This seems like a simple problem but i've searched the help files and tried
various options but failed, so apologies in advance for asking what i'm sure
is an easy thing to do!
In short, I have displayed behavioural data using the TraMineR package such
that there is a colour change between the transition of behaviours, however,
all the methods that i have used thus far have
2012 Feb 27
1
set heatmap.2 color ranges
Hi all,
I have a matrix with values between 0 and 1. I want to plot this matrix on a
heat map so anything >0.05 is blue, anything <=0.05 and >0.01 is yellow, and
anything else is grey. I am using the heatmap.2 function. I searched around
but did not find an efficient way to set colour ranges as I described. Could
anybody give some hints? Thank you in advance.
Wendy
--
View this
2010 Nov 04
3
Plotting a grid of directly specified colours
Dear R-help,
Could any of you direct me to a function for plotting a grid of colours,
directly specified by a matrix of hex colour codes? In other words I'm
looking for a heatmap() or image()-like function to which I can specify the
colour of each grid location directly, rather than providing a numerical
matrix and a 1D-colour scale (heatmap, image, levelplots,NeatMap...). I'm
surprised
2005 Aug 04
2
color palette
Hi, I have a matrix with both positive and negative
numbers, I would like to use image() to draw a
heatmap. How can I can design a palette (or is there a
function already available) that treat negative
numbers in a blue gradient and positive numbers in a
red gradient and treat 0 as white?
Thanks
2017 Nov 12
2
create waveform sawtooth
My tuneR sawtooth wave function generator is broken.
When I use the sine function, I get exactly what I expect: a sine wave whose frequency is defined by the freq parameter. In particular, higher frequencies have shorter wavelengths (more cycles per second means shorter waves). When I create a sawtooth wave, the opposite seems to occur: higher frequencies result in longer waves. But that?s not