[R] Populate matrix from data.frame

2007-06-27 Thread Andrej Kastrin
Dear all,

I have a data frame
a <- data.frame(cbind(x=c('a','a','a','b','c'), 
y=c('a','b','c','d','e'),z=c(1,2,3,4,5)))
 > a
  x y z
1 a a 1
2 a b 2
3 a c 3
4 b d 4
5 c e 5

and a matrix
mm <- matrix(0,5,5)
colnames(mm) <- c('a','b','c','d','e')
rownames(mm) <- c('a','b','c','d','e')
 > mm
  a b c d e
a 0 0 0 0 0
b 0 0 0 0 0
c 0 0 0 0 0
d 0 0 0 0 0
e 0 0 0 0 0

How to populate matrix in a way that first column of data frame 'a' 
correspond to rownames(mm), second column to colnames(mm) and the third 
column is the element of matrix 'mm'?

Thanks in advance,
Andrej

__
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 shadow 'power' area?

2007-06-25 Thread Andrej Kastrin
Dear all,

Suppose I plot two normal distributions (A and B) side by side and add 
vertical line which hipotheticaly represent alpha value; e.g.:

x <- seq(-3.5,5, length=1000)
y <- dnorm(x)
# Plot distribution A
plot(y~x, type='l',axes=F,xlab="",ylab="",lwd=2)
# Plot distribution B
y2 <- dnorm(x-1.5)
lines(y2~x,lwd=2)
# Plot vertical line for alpha value
abline(h=0)
segments(qnorm(.5)+1.5,0,qnorm(.5)+1.5,dnorm(qnorm(.5)))
text(2,0.2,"Power")

Now I want to shadow area labeled as "Power". Any suggestion how to do 
that using 'polygon' function?

Thanks in advance for any suggestion.

Andrej

__
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] gower distance calculation

2006-11-17 Thread Andrej Kastrin
Roy Spitz pravi:
> Hello
>
>  
>
> I have 2 rows in a matrix and I want to calculate the Gower Distance between
> the 2 , how can I do it?
> I searched and found nothing that can help me, and my program doesn't know
> the gdist function and I couldn't find it on the R help site.
>
>  
>
> Can anyone help me plz
>
>  
>
> Thank u all
>
>  
>
>
>   [[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.
>
>   
Look at the daisy function in the cluster package...

hth, andrej

__
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] R in Nature

2006-08-25 Thread Andrej Kastrin
Simon Blomberg wrote:
> Hi all,
>
> We've just had a paper accepted for publication in Nature. We used R for 
> 95% of our analyses (one of my co-authors sneaked in some GenStat when I 
> wasn't looking.). The preprint is available from the Nature web site, in 
> the open peer-review trial section. I searched Nature for previous 
> references to "R Development Core Team", and I received no hits. So I 
> tentatively conclude that our paper is the first Nature paper to cite R.
>
> A great many thanks to the R Development Core Team for R, and Prof. 
> Bates for lmer.
>
> Cheers,
>
> Simon.
> (I'm off to the pub to celebrate.)
>
>   
Congratulations
but I cannot find your article on 
http://blogs.nature.com/nature/peerreview/trial
Can you post valid link to it? Thanks in advance.

Andrej

__
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] Kmeans - how to display results

2006-08-05 Thread Andrej Kastrin
What's wrong with cross-tabs?

__
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] intersect() question

2006-07-15 Thread Andrej Kastrin
Gabor Grothendieck wrote:
> Define a generalized crossproduct and then apply it with
> the indicated function.  Multiply the diagonal elements by
> zero as the sample output seems to be forcing them that way.
>
> mm <- matrix(c(5, 1, 6, 6, 5, 7, 7, 3, 2), 3) # test matrix
>
> # generalized crossproduct
> inner <- function(a,b=a,f=crossprod)
> apply(b,2,function(x)apply(a,2,function(y)f(x,y)))
>
> inner(mm, f = function(x,y) length(intersect(x,y))) * !diag(ncol(mm))
>
>
>
> On 7/15/06, Andrej Kastrin <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I have a matrix containing ID numbers in each column. I would like to
>> program function which calculate common number of ID numbers between
>> each pair of columns.
>>
>> Suppose:
>>
>> 5 6 7
>> 1 5 3
>> 6 7 2
>>
>> Then the result should be:
>>
>> 0 2 0
>> 2 0 1
>> 0 1 0
>>
>> The main problem is how to implement intersect() function to walk
>> through each pair of columns and write result to result matrix.
>>
>> Thanks in advance for any suggestion, Andrej
>>
>> __
>> 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
>>
>
Thanks for fine solution.

__
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


[R] intersect() question

2006-07-15 Thread Andrej Kastrin
Hi,

I have a matrix containing ID numbers in each column. I would like to 
program function which calculate common number of ID numbers between 
each pair of columns.

Suppose:

5 6 7
1 5 3
6 7 2

Then the result should be:

0 2 0
2 0 1
0 1 0

The main problem is how to implement intersect() function to walk 
through each pair of columns and write result to result matrix.

Thanks in advance for any suggestion, Andrej

__
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


[R] Discretize data.frame

2006-07-12 Thread Andrej Kastrin
Dear useRs,

I use dics.ef function from dprep package to discretize continuous 
variable using intervals of equal frequencies. Dataset to be discretized 
include 4 continuous and 2 discrete variables in the following order:

Continuous Countinuous Countinuous Discrete Discrete Continuous

The problem emerge when I try to discretize the last continuos variable:

library(dprep)
dics.ef(my.dataframe, 1:6,5) ## all 6 variables in data.frame

I have no further idea why the function above don't work on the last 
variable in dataframe.

Thanks in advance for any further notes,

Andrej

__
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


Re: [R] kmeans clustering

2006-06-29 Thread Andrej Kastrin
richard mendes wrote:
> Hello R list members,
>
> I'm a bio informatics student from the Leiden university
> (netherlands). We were asked to make a program with different
> clustering methods. The problem we are experiencing is the following.
>
> we have a matrix with data like the following
>
>  research1research2research3enz
> sample1  0.5 0.2  0.4
>
> sample2  0.4 0.4  0.3
>
> sample3  0.7 0.2  0.8
>
> enz
>
>
> now if we use kmeans(matrix,3,20) the clustering method will cluster
> only on rows by using the columns values as multiple variables. The
> output from this syntax is for example
>
> sample1 = 1
> sample2 = 2
> sample3 = 3
> enz
>
> Is there a method that will use the rows and columns as seperate
> values so that every variable in the matrix will be assigned to a
> cluster instead of a row.
>
> the output then could be interperted as a heatmap.
>
> thank you in advance for your time,
>
> Richard Mendes
>
> __
> 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
>
>   
You mean something like:?
kmeans(dataMatrix,5) ## clustering by rows
kmeans(t(dataMatrix),5) ## clustering by attribute

HTH, Andrej

__
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


Re: [R] time series clustering

2006-06-06 Thread Andrej Kastrin
Spencer Graves wrote:
> I know of no software for time series clustering in R.  Google 
> produced some interesting hits for "time series clustering".  If you 
> find an algorithm you like, the author might have software. 
> Alternatively, the algorithm might be a modification of something 
> already available in R.  If that's the case, you wouldn't need to start 
> from scratch to program something since R is open source.
>
> hope this helps.
> Spencer Graves
>
> Weiwei Shi wrote:
>   
>> Dear Listers:
>>
>> I happened to have a problem requiring time-series clustering since the
>> clusters will change with time (too old data need to be removed from data
>> while new data comes in). I am wondering if there is some paper or reference
>> on this topic and there is some kind of implementation in R?
>>
>> Thanks,
>>
>> Weiwei
>>
>> 
>
> __
> 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
>
>   
Try to find the following article: Qualitative Clustering of Short 
Time-Series: A Case Study of Enterprise Reputation Data. It's a 
conference paper, but I have no electronic version of it.

HTH, Andrej

__
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


[R] Vector elements and ratios

2006-05-26 Thread Andrej Kastrin
Dear useRs,

I have two different length vectors: one column (1...m) and one row 
vector (1...n):

20
40
20
60

5 4 2

Now I have to calculate ratios between column vector elements and each 
row vector elements:

4 5 10
8 10 20
4 5 20
15 12 30

Thank's in advance for any suggestions,

Andrej

__
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


[R] rmeta: forest plot problem

2006-04-24 Thread Andrej Kastrin
Der useRs,

I'm working on meta analysis using rmeta package. Using code below I 
plot the forest plot:

library(rmeta)
data (catheter)
a<-meta.MH (n.trt, n.ctrl, col.trt, col.ctrl, data=catheter, names=Name, 
subset=c(13,6,5,3,7,12,4,11,1,8,10,2))
summary(a) # odds ratio values and confidence intervals
metaplot(a$logOR, a$selogOR, nn=a$selogOR^-2,a$names, summn=a$logMH, 
sumse=a$selogMH, sumnn=a$selogMH^-2, logeffect=TRUE)

Now I would like to add numerical odds ratio values and corresponding 
confidence intervals for each study on the second y axis (eg. 
http://www.statsdirect.com/help/meta_analysis/cochrane_plot.htm. I try 
with 'text' command, but the outcome is disastrous. If anyone can 
explain the best way to solve my problem, I should be very grateful.

Andrej

__
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


Re: [R] determining optimal # of clusters for a given dataset (e.g. between 2 and K)

2006-04-19 Thread Andrej Kastrin
andrew mcsweeny wrote:

>Hi:
>   
> I'm clustering a microarray dataset with a large # of samples.  I would 
> like your opinion on the best way to automatically determine the optimal # of 
> clusters.  Currently I am using the "cluster" package, clustering with 
> "clara", examining the average silhouette width at various numbers of 
> clusters.  I'd like opinions on whether any newer packages offer better 
> determination of optimal # of clusters, considering the algorithms in 
> "cluster" were developed decades ago.  By the way, I have alot of missing 
> values in my dataset, coded as "NA", so some software packages don't work.
>   
> Here is the code I've been using:
>   
>  library(cluster)
>  avgsil <- c()
>  
>for (k in  kseq){
>  clarares <- clara(data, k, rngR = TRUE)
>  savg <- clarares$silinfo$avg.width
>  print(c(k,savg))
>  avgsil[k] <- savg
>}
>  k<-kseq
>plot(k,avgsil[k])
>lines(k,avgsil[k])
>   
>  Sincerely,
>   
>  Andrew McSweeny
>  grad student
>  Medical University of Ohio
>
>   [[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
>
>  
>
Following Fraley  et al. I suggest to use the Bayesian inference 
function (BIC). You can find it in mclust package.

HTH, Andrej

__
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


Re: [R] Maximum Likelihood Estimation

2006-04-03 Thread Andrej Kastrin
Uwe Ligges wrote:
> [EMAIL PROTECTED] wrote:
>
>   
>> Hi,
>>
>> I would like to know how to configure R so that I can enter some values
>> and compute the Muximum likelihood estimation of my data.
>> 
>
> Maximum likelihood estimation of what?
> I do not know the definition of "Maximum likelihood estimation of [...] 
> data".
>
> Uwe Ligges
>
>
>
>   
>> Thanks
>> Victor.
>>
>> __
>> 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
>> 
>
> __
> 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
>
>   
Google for " Fitting Distributions with R". Excellent intro to your 
question...

HTH, Andrej

__
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


[R] Apply and more argumnts function

2006-03-04 Thread Andrej Kastrin
Dear useRs,

shame on me, but I have no idea how to apply two arguments function on 
my data. I have 2 vectors, 'n' and 'm' and  the function below:

n <- c(10,30,50,1000)
m <- c(10,50,100,200)

MonteCarlo <- function(n,m){
  temp <- NULL
  for(i in 1:m){
temp <- c(temp,walk(n)) # walk is external function
  }
  return(c(n,m,mean(temp),sd(temp)))
}

Now I have to calculate mean(temp) and sd(temp) for each pair of 
corresponding elements in vectors.

Thanks in advance, Andrej

__
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


Re: [R] Ubuntu and R

2006-02-16 Thread Andrej Kastrin
Clint Harshaw wrote:

>I've recently installed Ubuntu 5.10 on a desktop and need R installed, 
>however, even after uncommenting the repos associated with universe, 
>backports and multiverse, the packages available for Ubuntu are somewhat 
>out of date:
>
>[EMAIL PROTECTED]:~$ apt-cache policy r-base r-base-core
>r-base:
>   Installed: (none)
>   Candidate: 2.1.1-1
>   Version table:
>  2.1.1-1 0
> 500 http://archive.ubuntu.com breezy/universe Packages
>r-base-core:
>   Installed: (none)
>   Candidate: 2.1.1-1
>   Version table:
>  2.1.1-1 0
> 500 http://archive.ubuntu.com breezy/universe Packages
>
>How should I edit my /etc/apt/sources.list so that I can proplery 
>maintain a current version of R, and not break my system? I've searched 
>the forums at Ubuntu, and there are several similar requests there, but 
>no definitive answer that I found.
>
>What are other Ubuntu users here doing to keep their version of R fresh?
>
>Thanks,
>Clint
>  
>
Hi,

there is no up-to-date R package for Breezy. I have no problem with 
source installation; just follow the instructions and that's all. If you 
prefer package installation, try with checkinstall.

Cheers, Andrej

__
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


[R] for each element in matrix...

2006-02-05 Thread Andrej Kastrin
Dead R useRs,

I wrote function, which plot dotchart from given matrix, compute mean 
from diagonal elements and plot it with abline. In addition, if 
particular element of matrix is greater then mean value (i.e. 
mead.diagonal), it should be plot in red, otherwise in green color.

graph <- function(a) {
rownames(a) <- 1:nrow(a)
colnames(a) <- 1:ncol(a)
mean.diagonal <- mean(a[row(a) == col(a)])
par(bg = "gray95")
dotchart(a, cex = 0.9, main = "MeSH Plot", xlab = "frequency",
bg = ifelse((a) > mean.diagonal,"red", "green2"),  # !!!
pch = 21,labels = rownames(a))
abline(v = mean.diagonal, col = "red", lty = 4)
}

And now the main problem: I suppose that there is some mismatch in 
ifelse statement while I produce two totally different plots:
first input matrix:  A <-matrix(rep(c(1,3,4),3),3,3) # seem that works
second input matrix B <-matrix(rnorm(9),3,3) # total confusion between 
green and red points

Any advice would be appreciated,

Cheers, Andrej

__
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


[R] image() and text

2006-02-04 Thread Andrej Kastrin
Dear useRs,

I have 4×4 symmetrical matrix ; then I use

image(log(my.matrix)) to visualise it.

Is there any 'simple' way to add text labels into each cell lie on 
diagonal of the image plot? Thanks for any pointers...

Cheers, Andrej

__
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

Re: [R] Regex question

2006-01-28 Thread Andrej Kastrin
jim holtman wrote:

> Is this what you want?
>  
> > result <- readLines('/tempxx.txt')
> > result
> [1] "*NEW RECORD" "*ID-001" "*AB-text""""*NEW RECORD"
> [6] "*ID-002" "*AB-text"  
> > result <- result[grep('^.ID-', result)] # select only ID lines
> > result
> [1] "*ID-001" "*ID-002"
> > sub('^.ID-', '', result)
> [1] "001" "002"
>
>
>  
> On 1/28/06, *Andrej Kastrin* <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
>
> Dear R useRs,
>
> is there any simple, build in function to match specific regular
> expression in data file and write it to a vector. I have the
> following
> text file:
>
> *NEW RECORD
> *ID-001
> *AB-text
>
> *NEW RECORD
> *ID-002
> *AB-text
> etc.
>
> Now I have to match all ID fields and print them to a vector:
> 001
> 002
> etc.
>
> I know that this is very simple with Perl or R-Perl interface, but if
> possible, I want to do that 'on the hard way'.
>
> Cheers, Andrej
>
> __
> R-help@stat.math.ethz.ch <mailto: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
>
>
>
>
> -- 
> Jim Holtman
> Cincinnati, OH
> +1 513 247 0281
>
> What the problem you are trying to solve? 

I'm forever indepted to you for this.

Cheers, Andrej

__
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


[R] Regex question

2006-01-28 Thread Andrej Kastrin
Dear R useRs,

is there any simple, build in function to match specific regular 
expression in data file and write it to a vector. I have the following 
text file:

*NEW RECORD
*ID-001
*AB-text

*NEW RECORD
*ID-002
*AB-text
etc.

Now I have to match all ID fields and print them to a vector:
001
002
etc.

I know that this is very simple with Perl or R-Perl interface, but if 
possible, I want to do that 'on the hard way'.

Cheers, Andrej

__
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


[R] read.table problem

2006-01-25 Thread Andrej Kastrin
Dear R useRs,

I have big (23000 rows), vertical bar delimited file:

e.g.
A1|Text a,Text b, Text c|345
A2|Text bla|456
...
..
.

Try using

A <- read.table('filename.txt', header=FALSE,sep='\|')
 
process stop at line 11975 with warning message:
number of items read is not a multiple of the number of columns

I have no problems with processing similar file, which is only 1 
rows long?

Any suggestion what's the problem here. Thank's in advance.

Cheers, Andrej

__
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


[R] Distance between axis and x.lab

2006-01-24 Thread Andrej Kastrin
Dear R useRs,

what's the most elegant way to modify distance between x-axis and it's 
title. I didn't find any parameter to do that...

Thank's in advance,

cheers, Andrej

__
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


Re: [R] packages about microarray analysis

2006-01-19 Thread Andrej Kastrin
Vincent Deng wrote:

>Dear R-helpers,
>
>Can anybody suggest me some common packages for standard microarray
>analysis, either from CRAN or Bioconductor?
>
>
>Many thanks...
>
>   [[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
>
>  
>
Look at: http://ihome.cuhk.edu.hk/~b400559/arraysoft_rpackages.html

Cheers, Andrej

__
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


[R] For each element in vector do...

2006-01-17 Thread Andrej Kastrin
Dear R useRs,

I have a vector with positive and negative numbers:
A=c(0,1,2,3,0,4,5)

Now if  i-th element in vector A is > 0, then i-th element in vector B 
is a+1
else i-th element in vector b=a (or 0)

vector A: 0 1 2 3 0 4 5
vector B: 0 2 3 4 0 5 6

What's the right way to do this. I still have some problems with for and 
if statements...

Cheers,  Andrej

__
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


[R] Problem with plot()

2006-01-16 Thread Andrej Kastrin
Dear R useRs,

I have a problem to add title to the following graphics;

Tukey=TukeyHSD(aov(CA~C), "C",ordered=TRUE))
plot (Tukey, main="My first graph")

actually, it draw a graph, but it also display:

parameter "main" could not be set in high-level plot() function.

If I execute:
plot(rnorm(1000),main="My first plot"), no error occur.

What's the difference in those two examples? Thanks in advance.

__
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


[R] Multiple comparison and two-way ANOVA design

2006-01-15 Thread Andrej Kastrin
Dear useRs,

I'm working on multiple comparison design on two factor (2 × 3 levels) 
ANOVA. Each of the tests I have tried (Tukey, multcomp package) seem to 
do only with one factor at a time.


fm1 <- aov(breaks ~ wool * tension, data = warpbreaks)
tHSD <- TukeyHSD(fm1, "tension", ordered = FALSE)

$tension
  diff   lwrupr p adj
M-L -10.00 -19.35342 -0.6465793 0.0336262
H-L -14.72 -24.07564 -5.3688015 0.0011218
H-M  -4.72 -14.07564  4.6311985 0.4474210

I'm interested in posthoc comparisons between various levels of factor 1 
and various levels of factor 2, both at the same time.
I know that is possible in SPSS, but... is there any R solution?

Cheers, Andrej

__
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

Re: [R] Equal length axis

2006-01-15 Thread Andrej Kastrin
Andrej Kastrin wrote:

>Dear useRs,
>I am having difficulty to plot graphics with mfrow command, where both 
>axis are equal length. Below is sample code, which plots rectangles 
>instead of squares:
>
>par (mfrow=c(3,3))
>qqnorm(a)
>qqnorm(b)
>...
>..
>
>Thanks in advance for any pointers or notes.
>
>__
>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
>
>  
>
I done it myself:
par(mfrow=c(3,3),pty="s")
etc...

__
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


[R] Equal length axis

2006-01-15 Thread Andrej Kastrin
Dear useRs,
I am having difficulty to plot graphics with mfrow command, where both 
axis are equal length. Below is sample code, which plots rectangles 
instead of squares:

par (mfrow=c(3,3))
qqnorm(a)
qqnorm(b)
...
..

Thanks in advance for any pointers or notes.

__
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


[R] Split graph labels in 2 levels

2005-12-29 Thread Andrej Kastrin
Dear R users,

is there any simple low-level function that split "single-line" graph 
labels and produce something like (e.g. for x axis):

100300500   700...
 200400   600

Cheers, Andrej

__
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