It 'unwraps' the 200,000 x 2 matrix into a vector with 400,000
elements and giving you the location/subscripts of this vector that
matches the criterion. Instead you should use
apply(mat1, 2, function(y) which( y == 2 ))
which gives you the rows in each column that corresponds to 185.
Yes it looks like a really good student exercise into the sampling
properties of a distribution.
What you need to do is initialize vectors beforehand that will contain
the mean and variance values. Then simply use a for() loop that
generates 5 random numbers. Use the mean(), var() and store the
Dear all,
I am trying to create a web interface using Perl-CGI to call R plots and
to display them.
The following codes works perfectly fine when I copy and paste into the
console directly or if I save it into script.file and then R --no-save
script.file producing the graphs.
jpeg(graph.jpeg,
Dear all,
I fit independent GLMs for a 2x2 factorial problem on the data matrix of
size 9500 x 12 (genes x arrays) and get 9500 observed t-values using the
apply() function. Now, I wish to get the permutated p-values. Therefore
I random sample the class labels and perform the glm fitting to get
Well, you did not specify the object to save in write.table(). Suppose
you want to save the following:
x - matrix( c(1:25), nrow=5)
write.table(x, file=c:/my.output.file.txt)
If all goes well, you should see the prompt without any message.
Also use / rather than \ as it is reserved for escape
Being the lazy soul I am, I wish to write a function to replace saying
ls(pattern=...) everytime. Here is what I have:
lsp - function(x){
y - eval(deparse(substitute(x)))
print(y) # CHECK
print( ls(pattern = eval(y)) )# TRY 1
Here is another way of doing it:
x - c(1990, 1994, 1995, 1997)
all.x - seq(min(x), max(x))
complementary.x - setdiff(all.x, x)
-Original Message-
From: Sundar Dorai-Raj [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 12, 2003 9:39 PM
To: Remigijus Lapinskas
Cc: [EMAIL PROTECTED]
May I suggest you learn the handy function called which().
yes.rows - which(x[,1]==3)# Row that meets this condition
x[ yes, 2] - x[ yes.rows, 2] * 5 # Perform the desired change for the
row that meets this condition.
At 12:04 AM 2/9/2003 +0900, Mitsuo Igarashi wrote:
Hi All.
I am
What distance metric are you using? See if clara() in cluster library
etc is more appropriate.
-Original Message-
From: Vincent Stoliaroff [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 09, 2003 7:33 PM
To: [EMAIL PROTECTED]
Subject: [R] Clustering partition and memory
Dear
Dear all, I have a measurements from an experiment. Graphically I can
see there is one inflexion point but would like to automate this process
accurately. I am wondering if someone had written such a code (which I
think is similar to turnpoints() in library pastecs).
Thank you.
Regards, Adai.
Well, if you don't want to play with the margins, then I guess you have
to use the layout() function. You will want something similar to the
following if you want legends at the right:
def.par - par(no.readonly = TRUE)# save default
nf - layout( matrix( c(1,2), nrow=1), c(4,1) ) # If you want
I am attempting to replicate what Cluster 3.0 and Treeview (both by Mike
Eisen) to cluster both microarray genes and arrays does using R with
hclust. I basically utilized the plot.mat function in sma library with
some layout() and hclust().
1. Can I know if some has already written such a
401 - 412 of 412 matches
Mail list logo