[R] how can i fix the color for different image plot?

2006-11-01 Thread Jiantao Shi
Hi,

i defined the colors as follow for image function in R,
mycola=c(#00FF00,#0DF200,#1BE400,#28D700,#36C900,#43BC00,#51AE00,#5EA100,#6B9400,#798600,#867900,#946B00,#A15E00,#AE5100,#BC4300,#C93600,#D72800,#E41B00,#F20D00,#FF)

So when i use this color set to plot different data matrix which have
different max and min value, the same color in different figure represents
different value.
for example ,i have two data matrix,one with min= -2,max=3.5;the second with
min= -3,max=2.5;And i want to fix -3 to be the most blue(#00FF00),3 the most
red(#FF),what can i do ?
That is vales less than -3 will be plotted as -3, so for vales greater than
3.


Any suggestion?
Thanks in advance.

Jiantao Shi

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Is there a function in R can help me to plot such a figure?

2006-08-07 Thread Jiantao Shi
Hi,
i want to plot figure like this,
http://www.cis.hut.fi/projects/somtoolbox/download/pics2/shotvs2_colorcode.png
So is there a function or package in R can help me to do this.

Any suggestion will be appreciated.
Thanks in advance

Jiantao Shi

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Is there a function in R can help me to plot such a figure?

2006-08-07 Thread Jiantao Shi
This figure is the plot of prototype of a Self Organizing Maps(SOM)
result.The numeric data is a M*N matrix, M rows and N
columns.color2D.matplot can transform the numeric matrix to a color matrix
,but i have to put them  in  hexagon cells to reveal their topological
structure( M  hexagon cells in a column,N  hexagon cells in a row).

It seems that i have to use the GRID package in R.

On 8/8/06, Jim Lemon [EMAIL PROTECTED] wrote:

 Jiantao Shi wrote:
  Hi,
  i want to plot figure like this,
 
 http://www.cis.hut.fi/projects/somtoolbox/download/pics2/shotvs2_colorcode.png
  So is there a function or package in R can help me to do this.
 
 color2D.matplot transforms a numeric matrix into a color matrix, as does
 image. I don't know of an R function that does hexagon cells, although
 it wouldn't be impossible to program. What is the numeric data behind
 such a plot?

 Jim


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] How to add a line on the boxplot

2006-07-22 Thread Jiantao Shi
Hi,
I have a data frame,

 df=rnorm(1000)
 dim(df)=c(100,10)

And i can get the boxplot,

 boxplot(data.frame(df))


So how can add a line (aline) on the existing boxplot,eg,
aline=apply(df,2,max)

Thanks in advance.

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to add a line on the boxplot

2006-07-22 Thread Jiantao Shi
Thanks
The first method,i get many lines,using the second,i get segments.I actually
need one line with y coordinate defined by aline,x along the boxplot.


On 7/22/06, Uwe Ligges [EMAIL PROTECTED] wrote:

 Jiantao Shi wrote:

  Hi,
  I have a data frame,
 
 
 df=rnorm(1000)
 dim(df)=c(100,10)
 
 
  And i can get the boxplot,
 
 
 boxplot(data.frame(df))
 
 
 
  So how can add a line (aline) on the existing boxplot,eg,
 
 
  Thanks in advance.

 Example:


 df - rnorm(1000)
 dim(df) - c(100,10)
 boxplot(data.frame(df))
 aline - apply(df, 2, max)

 # , now you might want either
 abline(h = aline, col = green, lty=dotted)
 # or
 segments(seq(along = aline) - 0.2, aline,
  seq(along = aline) + 0.2, aline,
  lwd = 2, col = red)



 Uwe Ligges




[[alternative HTML version deleted]]
 
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.



[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] How to rep a matrix by row?

2006-04-29 Thread Jiantao Shi
Hi,
i have a dataframe like this,

SourceTreatDrugReplicate
 control0A1
 control10A2
 control30A3
 10A1


And i want to rep this  dataframe  3 times by row,the resulting  matrix  as
follow,

SourceTreatDrugReplicate
 control0A1
 control0A1
 control0A1
 control10A2
 control10A2
 control10A2
 control30A3
 control30A3
 control30A3
 10A1
 10A1
 10A1


So is there a easy way to do ?
thanks.

Jianao Shi

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html