[R] configure: WARNING: you cannot build info or HTML versions of the R manuals

2007-04-26 Thread W Eryk Wolski
Rusers,

I am trying to build R2.5 on my Kubuntu machine an configure concludes with
:

configure: WARNING: you cannot build info or HTML versions of the R manuals

What do I need to install on my machine to get rid of this warnings?


Eryk

[[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] tcltk support....

2007-04-26 Thread W Eryk Wolski
Rusers,

library(Rcmdr)
Loading required package: tcltk
Error in firstlib(which.lib.loc, package) :
Tcl/Tk support is not available on this system


While installing R I run configure with

configure --prefix=/bla/bla --with-tcltk
make
make install

configure did not returned any errors. Hence, I assume that the the tcl/tk
libraries have been found.


installin.packages(tcltk)
returns an error telling me that there is no package tcltk on CRAN. And
indeed there no such package on CRAN.

Whats wrong?

Eryk

[[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] configure: WARNING: you cannot build info or HTML versions of the R manuals

2007-04-26 Thread W Eryk Wolski


 Texinfo. Not sure if that is also the package name on *ubuntu/debian.


It's called texinfo on ubuntu/debian and it fixed the problem.

Thanks a lot Peter.

Eryk

[[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] tcltk support....

2007-04-26 Thread W Eryk Wolski
I use ubuntu/kubuntu...

I did not had the dev packages installed. The problem is no solved.

To my excuse I can say that I would have expected configure to issue an
error or warning.
I did run it  configure with --with-tcltk. But there was not a singel
message which would point me to the fact that some packages on my system are
missing.

cheers
Eryk



On 4/26/07, Stefan Grosse [EMAIL PROTECTED] wrote:

 tcltk must be installed on your system, it is not a R package. Which
 Linux are you using?

 W Eryk Wolski wrote:
  Rusers,
 
  library(Rcmdr)
  Loading required package: tcltk
  Error in firstlib(which.lib.loc, package) :
  Tcl/Tk support is not available on this system
 
 
  While installing R I run configure with
 
  configure --prefix=/bla/bla --with-tcltk
  make
  make install
 
  configure did not returned any errors. Hence, I assume that the the
 tcl/tk
  libraries have been found.
 
 
  installin.packages(tcltk)
  returns an error telling me that there is no package tcltk on CRAN. And
  indeed there no such package on CRAN.
 
  Whats wrong?
 
  Eryk
 
[[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] Translating actxserver server commands to rcom

2007-03-23 Thread W Eryk Wolski
Dear R and R com user

I have the following matlab which acesses a com server, code which I
am trying to translate to R using the Rcom package:


clear all;
clear analysis;
analysis = actxserver('EDAL.MSAnalysis');
analysis.Open('E:\work\ChromPeakFinderdata\DatafromKlaus\E112L-cad13-PI-24h_pos_1-C,3_01_2562.d');
specCol = analysis.MSSpectrumCollection;
count = specCol.get('Count');


This is how far I got...

rm(analysis)
analysis - comCreateObject(EDAL.MSAnalysis)
comGetObjectInfo(analysis)
comInvoke(analysis,open,E:\work\ChromPeakFinderdata\DatafromKlaus\E112L-cad13-PI-24h_pos_1-C,3_01_2562.d)
specCol - analysis$MSSpectrumCollection
 specCol
function (...)
comInvoke(handle, ..FUN, ...)
environment: 0x022a4734
 comInvoke(specCol,get,Count)
NULL


Seems to be the wrong track ... What would be the equivalent of
analysis.Open('E:\work\ChromPeakFinderdata\DatafromKlaus\E112L-cad13-PI-24h_pos_1-C,3_01_2562.d');
specCol = analysis.MSSpectrumCollection;
or  of count = specCol.get('Count');
in Rcom?


Help is highly appreciated...

best wishes

Eryk

__
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] qqmath - Lattice error

2006-05-25 Thread Witold Wolski
Hi,

Don't have a clue what teh following error message


generated by this function call:
qqmath( ~val|ind,data = xx
   ,distribution = function(p){ qt(p,df=20)}
   ,ylab=Sample Quatinles
   ,xlab=Theoretical Quantiles

   ,panel=function(x,y)
   {
 panel.qqmathline(y
  , distribution=function(p) qt(p,df=20)
  ,col=2)
 panel.qqmath(x, y
  , distribution=function(p) qt(p,df=20)
  ,pch=.,cex=2)
   }
)

means. Espacially that this function call

qqmath( ~val|ind,data = xx
   ,distribution = function(p){ qt(p,df=20)}
   ,ylab=Sample Quatinles
   ,xlab=Theoretical Quantiles
)

with the same data is working.

Thanks in advance for suggestions.

Eryk

[[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


Re: [R] qqmath - Lattice error

2006-05-25 Thread Witold Wolski
Hi,

Sorrry, I have forgotten to paste the error message:
Here it is:

 qqmath( ~val|ind,data = xx
+,distribution = function(p){ qt(p,df=20)}
+,ylab=Sample Quatinles
+,xlab=Theoretical Quantiles
+ #   ,aspect=1
+ #   ,prepanel = prepanel.qqmathline
+
+,panel=function(x,y)
+{
+  panel.qqmathline(y
+   , distribution=function(p) qt(p,df=20)
+   ,col=2)
+  panel.qqmath(x, y
+   , distribution=function(p) qt(p,df=20)
+   ,pch=.,cex=2)
+}
+ )
Error in panel(x = c(0.637018600046204, -0.0237681209798937, -
1.13188488395317,  :
unused argument(s) (NA ...)

As already mentioned the same dataset works fine with the short version of
the function call.
And this is how the data looks like.
class(xx)
[1] data.frame
 xx[1:10,]
   ind val
1  500-530  0.63701860
2  500-530 -0.02376812
3  500-530 -1.13188488
4  500-530  0.41095693
5  500-530 -1.02142435
6  500-530 -1.02142435
7  500-530  0.04185616
8  500-530 -1.29129448
9  500-530  1.17680295
10 500-530 -0.61137387

The first column are the levels. Even with this trunkated dataset the error
occurs.

Eryk

On 5/25/06, Deepayan Sarkar [EMAIL PROTECTED] wrote:

 On 5/25/06, Witold Wolski [EMAIL PROTECTED] wrote:
  Hi,
 
  Don't have a clue what teh following error message

 What's the error message?

 In any case, you seem to have wrong expectations about what
 panel.qqmath does, and in particular what arguments it accepts (this
 changed a few versions back). See help(panel.qqmath).

 Deepayan

  generated by this function call:
  qqmath( ~val|ind,data = xx
 ,distribution = function(p){ qt(p,df=20)}
 ,ylab=Sample Quatinles
 ,xlab=Theoretical Quantiles
 
 ,panel=function(x,y)
 {
   panel.qqmathline(y
, distribution=function(p) qt(p,df=20)
,col=2)
   panel.qqmath(x, y
, distribution=function(p) qt(p,df=20)
,pch=.,cex=2)
 }
  )
 
  means. Espacially that this function call
 
  qqmath( ~val|ind,data = xx
 ,distribution = function(p){ qt(p,df=20)}
 ,ylab=Sample Quatinles
 ,xlab=Theoretical Quantiles
  )
 
  with the same data is working.


[[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


Re: [R] qqmath - Lattice error

2006-05-25 Thread Witold Wolski
Thanks a lot!

Eryk

On 5/25/06, Sundar Dorai-Raj [EMAIL PROTECTED] wrote:



 Witold Wolski wrote:
  Hi,
 
  Don't have a clue what teh following error message
 
 
  generated by this function call:
  qqmath( ~val|ind,data = xx
 ,distribution = function(p){ qt(p,df=20)}
 ,ylab=Sample Quatinles
 ,xlab=Theoretical Quantiles
 
 ,panel=function(x,y)
 {
   panel.qqmathline(y
, distribution=function(p) qt(p,df=20)
,col=2)
   panel.qqmath(x, y
, distribution=function(p) qt(p,df=20)
,pch=.,cex=2)
 }
  )
 
  means. Espacially that this function call
 
  qqmath( ~val|ind,data = xx
 ,distribution = function(p){ qt(p,df=20)}
 ,ylab=Sample Quatinles
 ,xlab=Theoretical Quantiles
  )
 
  with the same data is working.
 
  Thanks in advance for suggestions.
 
  Eryk
 

 Hi, Eryk,

 The function panel.qqmath does not take an argument y.

 Here's a complete example (which you should have supplied):

 library(lattice)
 set.seed(1)
 xx - data.frame(ind = factor(rep(1:4, each = 100)))
 xx$val - rt(400, 20)
 qt2 - function(p) qt(p, df = 20)
 qqmath(~val | ind, data = xx,
 distribution = qt2,
 ylab = Sample Quantiles,
 xlab = Theoretical Quantiles,
 panel = function(x) {
   panel.qqmathline(x, distribution = qt2, col = 2)
   panel.qqmath(x, distribution = qt2, pch=., cex = 2)
 })

 --sundar

 P.S. Please (re-)read the posting guide. If you get an error in your
 script, tell us what it is. And provide an complete example (the posting
 guide gives guidelines here). Quite often I solve my own problem in the
 process of coming up with an example I'd like to post to R-help.


[[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


Re: [R] Problem with memory footprint of qq plot generated with lattice

2005-09-29 Thread Witold Eryk Wolski

Dave,

qqmath(~val|ind,data=xx
   ,distribution=function(p) qt(p,df=19)
   ,ylab=Sample Quatinles
   ,xlab=Theoretical Quantiles
   ,aspect=1
   ,prepanel = prepanel.qqmathline
   ,panel=function(x,y)
   {
 panel.qqmathline(y, distribution=function(p) qt(p,df=19),col=2)
 panel.qqmath(x, y , distribution=function(p)
qt(p,df=19),pch=.,cex=2)
   }
)

Adding f.value=fn as argument to qqmath reduces the size of the image, 
but neither the axis (absicissae) nor the line added by panel.qqmathline 
are right.


Adding f.value=fn as argument to panel.qqmathline and panel.qqmath 
generates the right graphic, but the size of the image is again 20 MB.


Any Suggestions?

Eryk

[EMAIL PROTECTED] wrote:

nwew [EMAIL PROTECTED] wrote:


Dear R helpers,




I generate a qq plot using the following function call.



...



dim(xx)
[1] 680237  2



How about doing something like this:

fn - function(n,cut=0.001,m=1000)
{
p - ppoints(n)
p - p[pmin(p, 1-p)  cut]
q - pt(seq(qt(cut,df=19),qt(1-cut,df=19),length=m),df=19)
sort(c(p,q))
}

then adding 'f.value=fn' to your qqmath arguments?  This essentially
says, plot the individual data points in the extreme tails of the
distribution (p  0.001 or p  0.999), and evaluate the distribution
at a sparse set of points in between, where the density means you
can't discern the individual values anyway.

-- Dave

__
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

Re: [R] regression methods for circular(?) data.

2005-09-26 Thread Witold Eryk Wolski

Hi,

I do not know the intercept and slope.
And you have to know them in order to do something like:
ix-(y  0.9*(x-50)/200

I am right?

cheers


(Ted Harding) wrote:

On 26-Sep-05 nwew wrote:


Dear R-users,

I have the following data

x - runif(300,min=1,max=230)

y - x*0.005 + 0.2
y - y+rnorm(100,mean=0,sd=0.1)
y - y%%1 #  --- modulo operation
plot(x,y)

and would like to recapture the slope (0.005) and intercept(0.2).
I wonder if there are any clever algorithms to do this. I was
looking at the function lm.cirucalar. Is this the method to use?
If, which of the references is best too look at?

Eryk



Hi Eryk,

If you know the modulus (in your case 1.0) and you get data that
look like the result of your plot(x,y), then I wouldn't mess
about.

I would simply do something like

y1-y
ix - ix-(y  0.9*(x-50)/200)
y1[ix] - y1[ix]+1.0
lm(y1~x)

(the constants 0.9/200, -50 being chosen to give a good separation
on the graph).

On the other hand, if there are good reasons why this very simple
approach is not suitable, then if we knew what they were a more
helpful reply would be easier to formulate!

Best wishes,
Ted.



E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 26-Sep-05   Time: 15:56:48
-- XFMail --

__
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

Re: [R] regression methods for circular(?) data.

2005-09-26 Thread Witold Eryk Wolski

Ted,

I agree with you that if you unwrap the data you can use lm.
And you can separate the data in the way you describe. However, if you 
have thousands of such datasets I do not want to do it by looking at 
the graph.


Yes the scatter may be larger as in the example and range(y) may be 
larger than 2.


And as you said in order to unwrap the data you have to separate them 
first. It would be easy to do it using for example single linkage 
clustering if they were no overlaps (but they do sometimes). So I were 
just wondering if there are no more fancy methods to do this.


Thanks,

cheers



(Ted Harding) wrote:

On 26-Sep-05 Witold Eryk Wolski wrote:


Hi,

I do not know the intercept and slope.
And you have to know them in order to do something like:
ix-(y  0.9*(x-50)/200

I am right?

cheers



Although I really knew them from the way you generated the data,
I pretended I did not know them.

Read below: If you know the modulus (in your case 1.0) -- I did
assume that this was known, i.e. that the data wrap round to 0
above 1.0. Also: the constants 0.9/200, -50 being chosen to give
a good separation on the graph -- I plotted the data, and saw that
the wrapped data were well separated, and that 0.9*(x-50)/200
was an adequate discriminant function. This was estimated purely by
eye, by looking at the graph, to find some line that went between
the two groups of data; no attempt was made to calculate anything
precisely. Apart from assuming that the modulus was 1.0, and that
the well-separated data at the bottom right of the graph were
wrapped round data, no other information was used by me!

So the question remains: If you can assume that the modulus is 1.0,
and that the wrapped-round data will be well separated, then all
is simple. All you need to do is to unwrap the wrapped data
by adding 1.0, having first identified them by virtue of their
obvious separation. Then you can estimate the slope by using 'lm'.

But:-- if you, Witold, can not assume these two things for your
real data, what can we assume in considering your question?
Is the modulus unknown, for instance? Is the scatter so large that
the groups are not well separated? Might we have twice-wrapped
data (i.e. original y  2)? 


In short, do your real data look like the data you sent us, and
are they wrapped at 1.0? or what?

With thanks, and best wishes,
Ted.



(Ted Harding) wrote:


On 26-Sep-05 nwew wrote:



Dear R-users,

I have the following data

x - runif(300,min=1,max=230)

y - x*0.005 + 0.2
y - y+rnorm(100,mean=0,sd=0.1)
y - y%%1 #  --- modulo operation
plot(x,y)

and would like to recapture the slope (0.005) and intercept(0.2).
I wonder if there are any clever algorithms to do this. I was
looking at the function lm.cirucalar. Is this the method to use?
If, which of the references is best too look at?

Eryk



Hi Eryk,

If you know the modulus (in your case 1.0) and you get data that
look like the result of your plot(x,y), then I wouldn't mess
about.

I would simply do something like

y1-y
ix - ix-(y  0.9*(x-50)/200)
y1[ix] - y1[ix]+1.0
lm(y1~x)

(the constants 0.9/200, -50 being chosen to give a good separation
on the graph).

On the other hand, if there are good reasons why this very simple
approach is not suitable, then if we knew what they were a more
helpful reply would be easier to formulate!

Best wishes,
Ted.



E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 26-Sep-05   Time: 15:56:48
-- XFMail --

__
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






E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 26-Sep-05   Time: 18:08:28
-- XFMail --


__
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] Interaction term in anova - how it should be written in a manuscript table?

2005-03-21 Thread Witold Eryk Wolski
Thanks a lot
cheers
Eryk
Marc Schwartz wrote:
For a me too post, I agree with Andy's recommendation, which in turn is
supported by How to Report Statistics in Medicine by Lang and Secic,
ACP, 1997. There is an example table (8.2) on page 133.
HTH,
Marc Schwartz
On Sun, 2005-03-20 at 15:44 -0500, Liaw, Andy wrote:
 

I'd suggest a $\times$ b, as you'd find in most stat textbook.
Andy
   

From: Witold Eryk Wolski
Dear Rgurus,
Interaction terms in the linear models function lm are 
specified by the 
colon :
eg: x ~ a + b + a:b

a shortcut for the above is:
x ~ a*b
the output if calling anova on the lm object will be the same 
in both cases

a 
b 
a:b ...
Resdiuals ...
What I am wondering is how the interaction term (a:b) given 
above should 
be written in a table in an manuscript?

a ) a*b
b ) a$\cdot$ b
c ) a:b
d) 
Cheers Eryk.
 

__
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
 


--
Witold Eryk Wolski
__(  School of Mathematics and Statistics _
\__/   University of Newcastle 'v'
||Newcastle upon Tyne, NE1 7RU, ENGLAND  /   \
^^mail: [EMAIL PROTECTED] m m
  Phone : 044 (0)191 222 5376
  FAX   : 044 (0)191 222 8020
__
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] Violin plot for discrete variables.

2005-03-21 Thread Witold Eryk Wolski
Dear Rgurus,
To my knowledge the best way to visualize the distribution of a discrete 
variable X is
plot(table(X))

The problem which I have is the following. I have to discrete variables 
X and Y which distribution I would like to compare. To overlay the 
distribution of Y with lines(table(Y)) gives not satisfying results. 
This is the same in case of using density or histogram.

Hence, I am wondering if there is a equivalent of the vioplot function 
(package vioplot) for discrete variables
which starts with a boxplot and than adds a rotated plot(table()) plot 
to each side of the box plot.

Maybee I should ask it first: Does such a plot make any sense? If not 
are there better solutions?

cheers
Eryk.
--
Witold Eryk Wolski
__(  School of Mathematics and Statistics _
\__/   University of Newcastle 'v'
||Newcastle upon Tyne, NE1 7RU, ENGLAND  /   \
^^mail: [EMAIL PROTECTED] m m
  Phone : 044 (0)191 222 5376
  FAX   : 044 (0)191 222 8020
__
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] Interaction term in anova - how it should be written in a manuscript table?

2005-03-20 Thread Witold Eryk Wolski
Dear Rgurus,
Interaction terms in the linear models function lm are specified by the 
colon :
eg: x ~ a + b + a:b

a shortcut for the above is:
x ~ a*b
the output if calling anova on the lm object will be the same in both cases
a 
b 
a:b ...
Resdiuals ...
What I am wondering is how the interaction term (a:b) given above should 
be written in a table in an manuscript?

a ) a*b
b ) a$\cdot$ b
c ) a:b
d) 
Cheers Eryk.
__
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] Concatenate vector into string

2005-03-04 Thread Witold Eryk Wolski
Matthieu Cornec wrote:
Hello,
I would like to convert c(a,b,c) into abc.
Anyone could help?
Thanks,
Matthieu Cornec
__
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
 

paste( c(a,b,c),collapse=)
Eryk
--
Witold Eryk Wolski
__(  School of Mathematics and Statistics _
\__/   University of Newcastle 'v'
||Newcastle upon Tyne, NE1 7RU, ENGLAND  /   \
^^mail: [EMAIL PROTECTED] m m
  Phone : 044 (0)191 222 5376
  FAX   : 044 (0)191 222 8020
__
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] Hot to _set_ an xmlAttr XML xmlAttr set

2005-03-03 Thread Witold Eryk Wolski
Dear R-Gurus!
I have read an xml document with
xmlTreeParse
and can access that attribute value by
xmlGetAttr
or
xmlAttrs
What I want to do is to set a new value and to write the modified DOM 
tree into an XML file.

But until now I have not found an setter method equivalent to the getter 
method?


Eryk

--
Witold Eryk Wolski
__(  School of Mathematics and Statistics _
\__/   University of Newcastle 'v'
||Newcastle upon Tyne, NE1 7RU, ENGLAND  /   \
^^mail: [EMAIL PROTECTED] m m
  Phone : 044 (0)191 222 5376
  FAX   : 044 (0)191 222 8020
__
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] Need suggestions for plotting 3D plot

2005-03-03 Thread Witold Eryk Wolski
Hi,
http://www.stat.ucl.ac.be/ISpersonnel/lecoutre/stats/fichiers/_gallery.pdf
The document above starts showing 3 different types of  3D graphics
persp
scatterplot3d
wireframe

A few days ago there was a discussion here on the list about providing a 
graph library.
During this discussion several resources of example code where mentioned 
( inter-alia that above).
So if you need more ideas follow search this e-mails.

cheers
Eryk

Soumyadeep nandi wrote:
Hi Everybody,
I am a newbie in R. I have a data in the form of a
matrix which I want to make some 3D plots using R.
There is some functions for instance hist() for 2D
plots, but I cant find any function for 3D plots. Is
there any function available in R for 3D plots? If so,
is there any documention available on internet so that
I can go through. 
With regards,
Soumyadeep

__
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
 


--
Witold Eryk Wolski
__(  School of Mathematics and Statistics _
\__/   University of Newcastle 'v'
||Newcastle upon Tyne, NE1 7RU, ENGLAND  /   \
^^mail: [EMAIL PROTECTED] m m
  Phone : 044 (0)191 222 5376
  FAX   : 044 (0)191 222 8020
__
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] The system command and the LD_LIBRARY_PATH

2005-02-22 Thread W.E. Wolski
Hi R-gurus,

In my envirovment I have specified the LD_LIBRARY_PATH to
/data/opt/libmy/lib

After starting R the LD_LIBRARY_PATH variable is changed.
 Sys.getenv(LD_LIBRARY_PATH)

/data/opt/R-devel//lib/R/lib:/usr/local/lib:/usr/X11R6/lib:/data/opt/libmy/lib
 


The problem is that in /usr/local/lib is an acient version of mylib hence
a call to _system_ with fails badly.



Suggestions?

Eryk

__
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] Renaming columns in data.frame, inserting/removing columns from data.frame

2005-02-08 Thread Witold Eryk Wolski
Ken Termiso wrote:
Hello,
I'm hoping that there is an easier way to rename columns in a data 
frame other than by using the names() assignment, which requires you 
to type in all the column names at once for a data.frame, in the case 
that I simply want to rename a single column in a data frame.

names(mydataframe)[column.index]-new.name
Also, is there an easy way to move columns in a data frame around 
relative to the other columns?

?subset
or
mydataframe[c(column3,column2,column1)]
Thanks in advance,
Ken
__
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


--
Dipl. bio-chem. Witold Eryk Wolski
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin
tel: 0049-30-83875219 __(_
http://www.molgen.mpg.de/~wolski  \__/'v'
http://r4proteomics.sourceforge.net||/   \
mail: [EMAIL PROTECTED]^^ m m
 [EMAIL PROTECTED]
__
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] Need your help with my R plot

2005-02-07 Thread Witold Eryk Wolski
Latha Raja wrote:
Hi,
I am using R to plot the graph and the problem I am facing with my graph is 
that I have lots of points concentrated in one area and It is creating a 
visualization challenge.
Is there any commands in R I could use to solve this problem.  Even if there is 
no command, do you know how I could tackle this problem...(I want to separate 
these points so I could see each of them...)
Any help is much appreciated...
Thank you kindly
Latha
__
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
 

Hi,
Take a look at the function:
ixyplot
in the package IDPmisc.
Eryk
--
Dipl. bio-chem. Witold Eryk Wolski
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin
tel: 0049-30-83875219 __(_
http://www.molgen.mpg.de/~wolski  \__/'v'
http://r4proteomics.sourceforge.net||/   \
mail: [EMAIL PROTECTED]^^ m m
 [EMAIL PROTECTED]
__
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] S4 class no longer accepts matrix in array slot under 2.0.1

2005-01-07 Thread Witold Eryk Wolski
Giles Heywood wrote:
I have an S4 class with a slot of class array, and in upgrading to 2.0.1
(from 1.9.1) I have encountered a change in behaviour. This causes me some
difficulties if I want to allow 2-dimensional arrays in the slot.
The following (in 2.0.1) illustrates the point:
 

setClass(foo,representation(array))
   

[1] foo
 

a - new(foo,array(NA,2:4))
b - new(foo,matrix(NA,2,3))
   

Error in as-(`*tmp*`, Classi, value = c(NA, NA, NA, NA, NA, NA)) :
   No method or default for as() replacement of foo with
Class=matrix
This last error did not occur under 1.9.1.
I conclude that in this context the methods package does not recognise
matrix as a subclass of array. However if I use getClass(), I see that R
recognises matrix as a subclass of array (and vice-versa).  So is this
new behaviour correct?
[this is a simplified (and final) reposting of an earlier question entitled
matrix no longer is array in 2.0.1?]
 

Hi,
 setClass(foo,representation(matrix))
[1] foo
 a - new(foo,array(NA,2:4))
 b - new(foo,matrix(NA,2,3))

Will work.
As you say array has a subclass matrix.
getClass(array)

Known Subclasses: matrix
and
getClass(matrix)
Known Subclasses:
Class array, directly, with explicit test and coerce
and matrix has a subclass array.
What probably is necessary to use polymorphism - assigning a subclass 
to the parent class is the explicit test and coearce.
It seems that matrix is the superclass of array.

/E
__
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
 



--
Dipl. bio-chem. Witold Eryk Wolski
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin
tel: 0049-30-83875219 __(_
http://www.molgen.mpg.de/~wolski  \__/'v'
http://r4proteomics.sourceforge.net||/   \
mail: [EMAIL PROTECTED]^^ m m
 [EMAIL PROTECTED]
__
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] scatterplot of 100000 points and pdf file format

2004-11-25 Thread Witold Eryk Wolski
Prof Brian Ripley wrote:
On Wed, 24 Nov 2004 [EMAIL PROTECTED] wrote:
On 24-Nov-04 Witold Eryk Wolski wrote:
Hi,
I want to draw a scatter plot with 1M  and more points
and save it as pdf.
This makes the pdf file large.
So i tried to save the file first as png and than convert
it to pdf. This looks OK if printed but if viewed e.g. with
acrobat as document figure the quality is bad.
Anyone knows a way to reduce the size but keep the quality?

If you want the PDF file to preserve the info about all the
1M points then the problem has no solution. The png file
will already have suppressed most of this (which is one
reason for poor quality).
I think you should give thought to reducing what you need
to plot.
Think about it: suppose you plot with a resolution of
1/200 points per inch (about the limit at which the eye
begins to see rough edges). Then you have 4 points
per square inch. If your 1M points are separate but as
closely packed as possible, this requires 25 square inches,
or a 5x5 inch (= 12.7x12.7 cm) square. And this would be
solid black!
Presumably in your plot there is a very large number of
points which are effectively indistinguisable from other
points, so these could be eliminated without spoiling
the plot.
I don't have an obviously best strategy for reducing what
you actually plot, but perhaps one line to think along
might be the following:
1. Multiply the data by some factor and then round the
  results to an integer (to avoid problems in step 2).
  Factor chosen so that the result of (4) below is
  satisfactory.
2. Eliminate duplicates in the result of (1).
3. Divide by the factor you used in (1).
4. Plot the result; save plot to PDF.
As to how to do it in R: the critical step is (2),
which with so many points could be very heavy unless
done by a well-chosen procedure. I'm not expert enough
to advise about that, but no doubt others are.

unique will eat that for breakfast
x - runif(1e6)
system.time(xx - unique(round(x, 4)))
[1] 0.55 0.09 0.64 0.00 0.00
length(xx)
[1] 10001


?table - reduces the data
and
?image - shows it.
And this is doing exactly what I need. (not my idea but one of Thomas 
Unternäher).  Thanks Thomas.

/E
--
Dipl. bio-chem. Witold Eryk Wolski
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin
tel: 0049-30-83875219 __(_
http://www.molgen.mpg.de/~wolski  \__/'v'
http://r4proteomics.sourceforge.net||/   \
mail: [EMAIL PROTECTED]^^ m m
 [EMAIL PROTECTED]
__
[EMAIL PROTECTED] 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] scatterplot of 100000 points and pdf file format

2004-11-24 Thread Witold Eryk Wolski
Hi,
I want to draw a scatter plot with 1M  and more points and save it as pdf.
This makes the pdf file large.
So i tried to save the file first as png and than convert it to pdf. 
This looks OK if printed but if viewed e.g. with acrobat as document 
figure the quality is bad.

Anyone knows a way to reduce the size but keep the quality?
/E
--
Dipl. bio-chem. Witold Eryk Wolski
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin
tel: 0049-30-83875219 __(_
http://www.molgen.mpg.de/~wolski  \__/'v'
http://r4proteomics.sourceforge.net||/   \
mail: [EMAIL PROTECTED]^^ m m
 [EMAIL PROTECTED]
__
[EMAIL PROTECTED] 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] scatterplot of 100000 points and pdf file format

2004-11-24 Thread Witold Eryk Wolski
Hi,
I tried the ps idea. But I am using pdflatex.
You get a even larger size reduction if you convert the ps into a pdf 
using ps2pdf.
But unfortunately there is a quality loss.

I have found almost a working solution:
a) Save the scatterplot without axes and with par(mar=c(0,0,0,0)) as png .
b) convert it using any program to pnm
c) read the pnm file using pixmap
d) Add axes labels and lines afterwards with par(new=TRUE)
And this looks like I would like that it looks like. But unfortunately 
acroread and gv on window is crashing when I try to print the file.

png(file=pepslop.png,width=500,height=500)
par(mar=c(0,0,0,0))
X2-rnorm(10)
Y2-X2*10+rnorm(10)
plot(X2,Y2,pch=.,xlab=,ylab=,main=,axes=F)
dev.off()
pdf(file=pepslop.pdf,width=7,height=7)
par(mar=c(3.2,3.2,1,1))
x - read.pnm(pepslop.pnm )
plot(x)
par(new=TRUE)
par(mar=c(3.2,3.2,1,1))
plot(X2,Y2,pch=.,xlab=,ylab=,main=,type=n)
mtext(expression(m[nominal]),side=1,line=2)
mtext(expression(mod(m[monoisotopic],1)),side=2,line=2)
legend(1000,4,expression(paste(lambda[DB],=,0.000495)),col=2,lty=1,lwd=1)
abline(test,col=2,lwd=2)
dev.off()

Marc Schwartz wrote:
On Wed, 2004-11-24 at 16:34 +0100, Witold Eryk Wolski wrote:
 

Hi,
I want to draw a scatter plot with 1M  and more points and save it as pdf.
This makes the pdf file large.
So i tried to save the file first as png and than convert it to pdf. 
This looks OK if printed but if viewed e.g. with acrobat as document 
figure the quality is bad.

Anyone knows a way to reduce the size but keep the quality?
   

Hi Eryk!
Part of the problem is that in a pdf file, the vector based instructions
will need to be defined for each of your 10 ^ 6 points in order to draw
them.
When trying to create a simple example:
pdf()
plot(rnorm(100), rnorm(100))
dev.off()
The pdf file is 55 Mb in size.
One immediate thought was to try a ps file and using the above plot, the
ps file was only 23 Mb in size. So note that ps can be more efficient.
Going to a bitmap might result in a much smaller file, but as you note,
the quality does degrade as compared to a vector based image.
I tried the above to a png, then converted to a pdf (using 'convert')
and as expected, the image both viewed and printed was pixelated,
since the pdf instructions are presumably drawing pixels and not vector
based objects.
Depending upon what you plan to do with the image, you may have to
choose among several options, resulting in tradeoffs between image
quality and file size.
If you can create the bitmap file explicitly in the size that you
require for printing or incorporating in a document, that is one way to
go and will preserve, to an extent, the overall fixed size image
quality, while keeping file size small.
Another option to consider for the pdf approach, if it does not
compromise the integrity of your plot, is to remove any duplicate data
points if any exist. Thus, you will not need what are in effect
redundant instructions in the pdf file. This may not be possible
depending upon the nature of your data (ie. doubles) without considering
some tolerance level for equivalence.
Perhaps others will have additional ideas.
HTH,
Marc Schwartz
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 


--
Dipl. bio-chem. Witold Eryk Wolski
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin
tel: 0049-30-83875219 __(_
http://www.molgen.mpg.de/~wolski  \__/'v'
http://r4proteomics.sourceforge.net||/   \
mail: [EMAIL PROTECTED]^^ m m
 [EMAIL PROTECTED]
__
[EMAIL PROTECTED] 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] scatterplot of 100000 points and pdf file format

2004-11-24 Thread Witold Eryk Wolski
Hi,
Yes, indeed the hexbin package generates very cool pix. They look great. 
I was using it already.
But this time I am interested in visualizing exactly the _scatter_ of 
some extreme points.

Eryk
Liaw, Andy wrote:
Marc/Eryk,
I have no experience with it, but I believe the hexbin package in BioC was
there for this purpose: avoid heavy over-plotting lots of points.  You might
want to look into that, if you have not done so yet.
Best,
Andy
 

From: Marc Schwartz
On Wed, 2004-11-24 at 16:34 +0100, Witold Eryk Wolski wrote:
   

Hi,
I want to draw a scatter plot with 1M  and more points and 
 

save it as pdf.
   

This makes the pdf file large.
So i tried to save the file first as png and than convert 
 

it to pdf. 
   

This looks OK if printed but if viewed e.g. with acrobat as 
 

document 
   

figure the quality is bad.
Anyone knows a way to reduce the size but keep the quality?
 

Hi Eryk!
Part of the problem is that in a pdf file, the vector based 
instructions
will need to be defined for each of your 10 ^ 6 points in 
order to draw
them.

When trying to create a simple example:
pdf()
plot(rnorm(100), rnorm(100))
dev.off()
The pdf file is 55 Mb in size.
One immediate thought was to try a ps file and using the 
above plot, the
ps file was only 23 Mb in size. So note that ps can be more 
efficient.

Going to a bitmap might result in a much smaller file, but as 
you note,
the quality does degrade as compared to a vector based image.

I tried the above to a png, then converted to a pdf (using 'convert')
and as expected, the image both viewed and printed was pixelated,
since the pdf instructions are presumably drawing pixels and 
not vector
based objects.

Depending upon what you plan to do with the image, you may have to
choose among several options, resulting in tradeoffs between image
quality and file size.
If you can create the bitmap file explicitly in the size that you
require for printing or incorporating in a document, that is 
one way to
go and will preserve, to an extent, the overall fixed size image
quality, while keeping file size small.

Another option to consider for the pdf approach, if it does not
compromise the integrity of your plot, is to remove any duplicate data
points if any exist. Thus, you will not need what are in effect
redundant instructions in the pdf file. This may not be possible
depending upon the nature of your data (ie. doubles) without 
considering
some tolerance level for equivalence.

Perhaps others will have additional ideas.
HTH,
Marc Schwartz
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

   


--
Notice:  This e-mail message, together with any attachments, contains information of 
Merck  Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), 
and/or its affiliates (which may be known outside the United States as Merck Frosst, 
Merck Sharp  Dohme or MSD and in Japan, as Banyu) that may be confidential, 
proprietary copyrighted and/or legally privileged. It is intended solely for the use of 
the individual or entity named on this message.  If you are not the intended recipient, 
and have received this message in error, please notify us immediately by reply e-mail 
and then delete it from your system.
--
 


--
Dipl. bio-chem. Witold Eryk Wolski
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin
tel: 0049-30-83875219 __(_
http://www.molgen.mpg.de/~wolski  \__/'v'
http://r4proteomics.sourceforge.net||/   \
mail: [EMAIL PROTECTED]^^ m m
 [EMAIL PROTECTED]
__
[EMAIL PROTECTED] 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] R/S-related projects on Sourceforge? Trove Categorization

2004-11-18 Thread Witold Eryk Wolski
Hi,
This are the project which I have extracted from all your mails.
 
1. http://sourceforge.net/projects/rpgsql/  R PostgreSQL Interface
2. http://sourceforge.net/projects/r-spatial/   R package for spatial 
data classes
3. http://sourceforge.net/projects/rpy/ RPy (R from Python)
4. http://sourceforge.net/projects/ep-sf/   Expression Profiler
5. http://sourceforge.net/projects/fsap fish stock assessment for R
6. http://sourceforge.net/projects/flr/ R packages for use in 
fisheries modelling
7. https://sourceforge.net/projects/runit/  R Unit Test Framework
8. http://sourceforge.net/projects/ep-sf/   Expression Profiler
9. http://sourceforge.net/projects/r-asp/   Analysis of Spatial Data 
in R
10. http://sourceforge.net/projects/r4proteomics/  R Packages for proteomics
11. http://sourceforge.net/projects/rdbi/  R Database Interface
12. http://sourceforge.net/projects/nlmeode/   R package combining 
nlme and odesolve
13. http://sourceforge.net/projects/rarcinfo/  RArcInfo
14. http://sourceforge.net/projects/rgdal  GDAL Package for R
15. http://sourceforge.net/projects/gretl/ GNU Regression, 
Econometrics and Time-series Library
16. ...

Sorry if I have missed any. But it is surely more than five.
Thanks all of you for your numerous response and also for some more 
general thoughts concerning
*collaboratory* development using source code repositories:
https://stat.ethz.ch/pipermail/r-devel/2004-November/031398.html.
If I see how R is evolving I believe that this ideas will be realized soon.
Especially that there are already repositories covering some of the 
functionality and dedicated to R --  Bioconductor  with a svn archive. 
Unfortunately, as I was told by Geff Gentry the costs of administering 
the svn, cvs servers are high, hence the number of developers must be 
limited. Also CRAN has some of the functionality but the svn or cvs 
support is missing.
Luckily hosting the sources on e.g. sourceforge and the builds on CRAN 
or Bioconductor gives already some of the essential functionality.

Therefore at this place big thanks to the Bioconductor, CRAN and 
sourceforge people.

/E
__
[EMAIL PROTECTED] 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] R/S-related projects on Sourceforge? Trove Categorization

2004-11-17 Thread Witold Eryk Wolski
Hi R-Users and Developers,
Several months ago I made a request on Sourceforge to add the R/S - 
programming language to the _Trove_ categorization. (The Trove is a 
means to convey basic metainformation about your project.)

Today I got the following response of one of the sourceforge admins.
SNIP
SourceForge.net will consider the inclusion of a programming
language within the Trove system when we host at least 5
projects based on that language.  Please advise: Do you know
of 5 projects hosted on SourceForge.net based on this language?
SNIP
If anyone of you knew about R-packages, or projects using the R/S 
programming language, which are hosted on sourceforge, please reply to this 
thread. I hope that your answers will enable me to give more then 5 examples of 
R projects hosted on Sourceforge.
Yours Eryk
Ps.
The ID of my original feature request  on Sourceforge is 967697.
https://sourceforge.net/tracker/?func=detailatid=350001aid=967697group_id=1
--
Dipl. bio-chem. Witold Eryk Wolski
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin
tel: 0049-30-83875219 __(_
http://www.molgen.mpg.de/~wolski  \__/'v'
http://r4proteomics.sourceforge.net||/   \
mail: [EMAIL PROTECTED]^^ m m
 [EMAIL PROTECTED]
__
[EMAIL PROTECTED] 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] - assignment no long work in class methods

2004-11-10 Thread Witold Eryk Wolski
Gang Liang wrote:
Hi-
I used to use - to do assignment inside a class method, and
just found that now it is broken in R 2.0. For example, the
following code
---
setClass( myclass, representation(x=numeric) )
setGeneric(incrXByOne, function(obj) standardGeneric(incrXByOne))
setMethod( incrXByOne, myclass, function(obj) [EMAIL PROTECTED] - [EMAIL 
PROTECTED] + 1 )
 

Hi,
What (my guess) you want to define is:
setMethod( incrXByOne, myclass, function(obj) [EMAIL PROTECTED] - [EMAIL 
PROTECTED] + 1;obj})
You do not need - to assign to a function argument? Its in my view 
even erroneous.

This S code gives an error too.
test - function(x)
{
x$bla-x$bla + 1
}
test(1)
Error in test(1) : Object x not found
/E
incrXByOne( new(myclass) )
---
will give an error message like:
  Error in incrXByOne(new(myclass)) : Object obj not found
  ## R failed to trace the object back to the GlobalEnv...
It used to work under R1.7 - 1.9. I don't know whether this is a
bug or a new feature...
Anyone can recommend a workaround?
Thanks, Gang
-
debian unstable, kernel 2.6.8
 

version
   

platform i386-pc-linux-gnu
arch i386
os   linux-gnu
system   i386, linux-gnu
status
major2
minor0.0
year 2004
month10
day  04
language R
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 


--
Dipl. bio-chem. Witold Eryk Wolski
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin
tel: 0049-30-83875219 __(_
http://www.molgen.mpg.de/~wolski  \__/'v'
http://r4proteomics.sourceforge.net||/   \
mail: [EMAIL PROTECTED]^^ m m
 [EMAIL PROTECTED]
__
[EMAIL PROTECTED] 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] gplot.hexbin - how to set figure margin.

2004-11-09 Thread Wolski
Hi,

Would like to use to the hexbin package to plot a 2D hist - because it looks 
really _cool_.
My problem  is related to  drawing a pdf hexbin graphic in series of other 
graphics.
All other figures have a par(mar=c(3.2,3.2,1,1)). So the gplot.hexbin figure in 
this series looks a little alienated?

Was trying a to specify the _mar_ using par, viewport, hexViewport etc. a 
little.

My question. How to set the margins in the sample code below. 


x - rnorm(1)
y - rnorm(1)
bin - hexbin(x,y)

## Plot : Note that 'gplot.hexbin' is the S4 plot method for hexbin !
##    --
plot(bin)


/E


Dipl. bio-chem. Eryk Witold Wolski @MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin'v'
tel: 0049-30-83875219/   \   
mail: [EMAIL PROTECTED]---W-W
http://r4proteomics.sourceforg.net

__
[EMAIL PROTECTED] 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] how lambda is computed in smoot.spline given _df_

2004-11-08 Thread Wolski
Hi,

I posted some days ago a question concerning the computation of lambda in the 
smooth.spline function (which I repreat at the bottom of the mail) given _df_ . 
Unfortunately the documentation is not clear to me. Maybee someone can help to 
answer in my view the basic question: 

If the penalized log likelihood is L = (y - f)' W (y - f) + lambda c' Sigma c

how the _lambda_ in the above equation is computed if _df_ is given and _spar_ 
not?

And, Is there a way to define lambda directly?

Yours.
/E


Hi,

I am usign the smooth.spline function. 

I am not sure how the _df_ (degrees of freedom) parameter, 
if set, influences _lambda_ in eq:

L = (y - f)' W (y - f) + lambda c' Sigma c

Is _df_  substituting tr(Sigma), if defined, in the equation: r = tr(X' W X) / 
tr(Sigma) 
which is used to compute: lambda = r * 256^(3*spar - 1)?


And how _spar_ is set if not defined?

/E

__
[EMAIL PROTECTED] 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] smooth.spline _df_ parameter?

2004-11-05 Thread Wolski
Hi,

I am usign the smooth.spline function. 

I am not sure how the _df_ (degrees of freedom) parameter, 
if set, influences _lambda_ in eq:

L = (y - f)' W (y - f) + lambda c' Sigma c

Is _df_  substituting tr(Sigma), if defined, in the equation: r = tr(X' W X) / 
tr(Sigma),
which is used to compute: lambda = r * 256^(3*spar - 1)?


How _spar_ is set if not defined?


/E



Dipl. bio-chem. Eryk Witold Wolski @MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin'v'
tel: 0049-30-83875219/   \   
mail: [EMAIL PROTECTED]---W-W
http://r4proteomics.sourceforg.net

__
[EMAIL PROTECTED] 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] How to add values to an array at any position.

2004-10-30 Thread Witold Eryk Wolski
Hi,
How to add values to an array at any position.
Asking because of the following:
e.g.
y-c(0.1,NaN,0.2,NaN) #or data frame
x-na.omit(y)
take some columns from x and
do some computation with functions which do not allow NaN 's.
After the computing add NaN's at positions stored in
attr(x,na.action)
of the result vector.
/E
--
Dipl. bio-chem. Witold Eryk Wolski
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin
tel: 0049-30-83875219 __(_
http://www.molgen.mpg.de/~wolski  \__/'v'
http://r4proteomics.sourceforge.net||/   \
mail: [EMAIL PROTECTED]^^ m m
 [EMAIL PROTECTED]
__
[EMAIL PROTECTED] 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] How to add values to an array at any position.

2004-10-30 Thread Witold Eryk Wolski
Hi,
In the first place I was wondering if there are no function 
_insert.vector_  in base.

Thanks Peter and Gabor even for the bad news.
E.
Peter Dalgaard wrote:
Witold Eryk Wolski [EMAIL PROTECTED] writes:
 

Hi,
How to add values to an array at any position.
Asking because of the following:
e.g.
y-c(0.1,NaN,0.2,NaN) #or data frame
x-na.omit(y)
take some columns from x and
do some computation with functions which do not allow NaN 's.
After the computing add NaN's at positions stored in
attr(x,na.action)
of the result vector.
   

You mean, something like
ix - attr(x, na.action)
newres - c(res,rep(NA,length(ix))) # just to get size and mode right
newres[ix] - NA
newres[-ix] - res
 


--
Dipl. bio-chem. Witold Eryk Wolski
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin
tel: 0049-30-83875219 __(_
http://www.molgen.mpg.de/~wolski  \__/'v'
http://r4proteomics.sourceforge.net||/   \
mail: [EMAIL PROTECTED]^^ m m
 [EMAIL PROTECTED]
__
[EMAIL PROTECTED] 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] usage and behavior of 'setIs'

2004-10-25 Thread Witold Eryk Wolski
Hi Matthias,
A similar problem to yours (with one level of inheritance less) was 
disccussed this month on the r-devel list.
You find an answer from JChambers here:

https://stat.ethz.ch/pipermail/r-devel/2004-October/030980.html
And yes specifying _setAs_  to each _setIs_ with the coerce and replace 
is a _hack_ which is with this version of methods necessary when 
inherting from Old Classes.

/E
[EMAIL PROTECTED] wrote:
Hello,
am I using 'setIs' in the correct way in the subsequent (artifical) example?
Do I have to specify explicit 'setAs' for 'list' and 'vector' or
should this work automatically, since getClass(List1) states
an explicit coerce also for these classes.
I'm working with R 2.0.0 Patched (2004-10-06) on windows 2000.
Thanks for your advice,
Matthias
# example
setClass(Class = List1, representation(List = list))
setClass(Class = List2, contains = list)
setIs(class1 = List1, class2 = List2,
   coerce = function(obj){ new(List2, [EMAIL PROTECTED]) },
   replace = function(obj, value){
   [EMAIL PROTECTED] - value
   })
getClass(List1)
# states explicit coerce for 'list' and 'vector'
getClass(List2)
L1 - new(List1, List = list(a))
# all TRUE
is(L1, List2)
is(L1, list)
is(L1, vector)
as(L1, List2) # works
# both return 'list()'
# why not a 'list' with entry a?
# Is there an additional 'setAs' needed?
as(L1, list)
as(L1, vector)
L2 - as(L1, List2)
as(L2, list) # works
as(L2, vector) # works
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 


--
Dipl. bio-chem. Witold Eryk Wolski
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin
tel: 0049-30-83875219 __(_
http://www.molgen.mpg.de/~wolski  \__/'v'
http://r4proteomics.sourceforge.net||/   \
mail: [EMAIL PROTECTED]^^ m m
 [EMAIL PROTECTED]
__
[EMAIL PROTECTED] 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] Intro to R: lecture presentation

2004-10-25 Thread Witold Eryk Wolski
Same behavior with Firefox 1.0Pr.
/E
Thomas Schönhoff wrote:
Hello Arin,
Arin Basu schrieb:
A couple of weeks back, I asked a question on the list that I was 
invited to provide an introductory lecture on R to a group of 
academicians in Kolkata. I thank all of you who had generously guided 
me in providing me web links and words to the wise.
Time to give back. I did the presentation on introduction to R and 
uploaded the presentation files at the following site:

http://www.aloofhosting.com/arinbasu/Rtutorial/Rintroweb_files/frame.htm
A shortened form of url is here (easy for cutting and pasting):
http://tinyurl.com/3zsr6
Would greatly appreciate your feedbacks/opinions/advices on 
errors/omissions.

Both links don't work for me, simply get an empty page and a black 
frame on both websites (IE optimzed?) running Mozilla-1.7.x on Debian 
GNU/Linux.

sincerely
Thomas
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html


--
Dipl. bio-chem. Witold Eryk Wolski
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin
tel: 0049-30-83875219 __(_
http://www.molgen.mpg.de/~wolski  \__/'v'
http://r4proteomics.sourceforge.net||/   \
mail: [EMAIL PROTECTED]^^ m m
 [EMAIL PROTECTED]
__
[EMAIL PROTECTED] 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] plot.dendrogram and plot.hclust ZOOM into the height?

2004-10-19 Thread Witold Eryk Wolski
Hi,
I clustered a distance matrix and would like to draw it using 
plot.hclust or plot.dendrogram.
The dendrogram is not informative because I have a few extremely small 
dissimilarities in the distance matrix (e.g. 0), but most of the other 
distances are in the range 1e10+-5000.
I would like to show the tree only for the height of 1e10+-5000 but 
unfortunately their are no parameter like xlim,ylim in the function?
Are there other ways to ZOOM?

Any suggestions?
/E
--
Dipl. bio-chem. Witold Eryk Wolski
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin
tel: 0049-30-83875219 __(_
http://www.molgen.mpg.de/~wolski  \__/'v'
http://r4proteomics.sourceforge.net||/   \
mail: [EMAIL PROTECTED]^^ m m
 [EMAIL PROTECTED]
__
[EMAIL PROTECTED] 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] Re: plot.dendrogram and plot.hclust ZOOM into the height?

2004-10-19 Thread Witold Eryk Wolski
Hi,
Just noted that
dendr2 - cut(dendr1,h=1)
plot(dendr2$upper)
Gives what I am looking for.
Sorry, Its quite late here.
/E
Witold Eryk Wolski wrote:
Hi,
I clustered a distance matrix and would like to draw it using 
plot.hclust or plot.dendrogram.
The dendrogram is not informative because I have a few extremely small 
dissimilarities in the distance matrix (e.g. 0), but most of the other 
distances are in the range 1e10+-5000.
I would like to show the tree only for the height of 1e10+-5000 but 
unfortunately their are no parameter like xlim,ylim in the function?
Are there other ways to ZOOM?

Any suggestions?
/E

--
Dipl. bio-chem. Witold Eryk Wolski
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin
tel: 0049-30-83875219 __(_
http://www.molgen.mpg.de/~wolski  \__/'v'
http://r4proteomics.sourceforge.net||/   \
mail: [EMAIL PROTECTED]^^ m m
 [EMAIL PROTECTED]
__
[EMAIL PROTECTED] 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] C/C++

2004-10-15 Thread Witold Eryk Wolski
Hi,
Unfortunately I have only some beginners hints to this very interesting 
topic.

Writing R extensions provides examples how to execute r functions from 
within C code.
There is also somewhere a doc how to use R as a shared library (?). But 
I dont remember in which doc exactly.

Furthermore Rserv:
rserv (http://www.rosuda.org/Rserve/index.shtml) has a C++ API for 
calling r functions.

Eryk.

doktora v wrote:
Hey everyone,
I have been looking for a while for ways to integrate R's wonderful
functions into my C++ software, but I have not found anything
concrete.
So finally, i post to this list to see if anyouse else knows about
this, or has done it!? Is it possible? Are there C++ or C R libraries?
Or is it sufficiently easy to build them?
your help is much appreciated!
thanks
doktora
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 


--
Dipl. bio-chem. Witold Eryk Wolski
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin
tel: 0049-30-83875219 __(_
http://www.molgen.mpg.de/~wolski  \__/'v'
http://r4proteomics.sourceforge.net||/   \
mail: [EMAIL PROTECTED]^^ m m
 [EMAIL PROTECTED]
__
[EMAIL PROTECTED] 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] colClasses

2004-10-11 Thread Witold Eryk Wolski
I would try.
colClasses=c(character,numeric,character,numeric,numeric)
/E
Kalaylioglu, Zeynep (IMS) wrote:
Hi
I am trying to read a data frame from a text editor in to R. I want some
of the columns to be read in as character not numeric.
I figured that I can do that by using colClasses in  read.table
command. However, I couldn't find out how to use 
colClasses. e.g. say I have 5 column in the data file. I want 1st and
3rd column to be read in as character. How can I define
this using colClasses?  (or is there a better way to do what I want?)

Thanks.
Zeynep

[[alternative HTML version deleted]]
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 


--
Dipl. bio-chem. Witold Eryk Wolski 
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin _
tel: 0049-30-83875219 __(   'v'
http://www.molgen.mpg.de/~wolski  \__/   /   \
mail: [EMAIL PROTECTED]^^ w w
 [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] R-(wiki)-pedia?

2004-10-07 Thread Witold Eryk Wolski
Thomas Petzoldt wrote:
Tony Plate wrote:
 At Thursday 11:29 AM 10/7/2004, Dan Bolser wrote:

[snip] I just added some pages... I think it would be great if 
people could get motivated to contribute to something like this. Its 
one of those cases of just getting the ball rolling...

Do you think you can dump the existing R-docs into this wiki as a 
framework to get things going?

If the existing R-docs are dumped into a wiki, won't the copy in 
the Wiki quickly get out of date? How does one get around this problem?

And another problem is, how to reverse from something like HTML or XML 
back to .Rd ? I think that a generic format is absolutely necessary. 
The generic format we have and not yet another source of confusion.

If wiki means editing .Rd sources or better: inverse transformation in 
both sides (without to many loss), it would be nice. Is there really a 
chance?

Shurely their is. Define an XML schema. Write functions Rd2XML, XML2Rd,  
twiki2XML,  .
I am looking since ages for something like R2XML and XML2Rd.
If we can agree on an XML format for the documentation it will be 
something to start with.

Yours

Thomas P.
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html


--
Dipl. bio-chem. Witold Eryk Wolski 
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin _
tel: 0049-30-83875219 __(   'v'
http://www.molgen.mpg.de/~wolski  \__/   /   \
mail: [EMAIL PROTECTED]^^ w w
 [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] setClass - equvalent declarations?

2004-10-06 Thread Witold Eryk Wolski
Hi,
Why the third declation is not equivalent to the first 2 and gives a Warning
#1
setClass(MVE,representation(list,names=character))
#2
setClass(
MVE
,contains=list
,representation(
   names=character
   )
)
#3
setClass(MVE,matrix,representation(names=character))
[1] MVE
Warning message: 
prototype is a list with named elements (could be ambiguous):  better to use function prototype() to avoid trouble. in: reconcilePropertiesAndPrototype(name, slots, prototype, superClasses,  

/E.

--
Dipl. bio-chem. Witold Eryk Wolski 
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin _
tel: 0049-30-83875219 __(   'v'
http://www.molgen.mpg.de/~wolski  \__/   /   \
mail: [EMAIL PROTECTED]^^ w w
 [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] Reading multiple files into R

2004-10-01 Thread Witold Eryk Wolski
Hi!
There is a function ?dir which returns you the content of the dir_ectory.
If this is more then there is a function ?grep which allows you to 
extract relevant items.
If you need to postprocess the names you have a function ?paste for example.
And finally you have an S language construct for(){}
And there is help.search() and An Introduction to R to which tells you 
how to write functions.

/E

Vikas Rawal wrote:
I want to read data from a number of files into R.
Reading individual files one by one requires writing enormous amount 
of code that will look something like the following.


maptools:::dbf.read(wb-01vc.dbf)-dist1
maptools:::dbf.read(wb-02vc.dbf)-dist2
maptools:::dbf.read(wb-03vc.dbf)-dist3
maptools:::dbf.read(wb-04vc.dbf)-dist4
maptools:::dbf.read(wb-05vc.dbf)-dist5
maptools:::dbf.read(wb-06vc.dbf)-dist6
maptools:::dbf.read(wb-07vc.dbf)-dist7
maptools:::dbf.read(wb-08vc.dbf)-dist8
maptools:::dbf.read(wb-09vc.dbf)-dist9
*
Is there a better way of doing this?
Vikas
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html


--
Dipl. bio-chem. Witold Eryk Wolski 
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin   _
tel: 0049-30-83875219   'v'
http://www.molgen.mpg.de/~wolski   /   \
mail: [EMAIL PROTECTED]  ---W-W
 [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] Rnewsletter article example

2004-10-01 Thread Witold Eryk Wolski
me too,
E,
Samuel Kemp wrote:
Hi,
I am trying to write an article for the Rnewsletter, but keep getting 
errors. I have googled around for some decent examples that contain 
figures, maths, etc but with no joy. Would any be so kind as to send 
me an example article in latex code?

Cheers,
Sam.
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html


--
Dipl. bio-chem. Witold Eryk Wolski 
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin   _
tel: 0049-30-83875219   'v'
http://www.molgen.mpg.de/~wolski   /   \
mail: [EMAIL PROTECTED]  ---W-W
 [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] function by

2004-09-30 Thread Witold Eryk Wolski
?by
FUN: a function to be applied to data frame subsets of 'data'.
...: further arguments to 'FUN'.
by (SS, year, sum)
/E

Emilie Berthiaume wrote:
Hi,
I'm just getting started with R and I'm having problems with some simple
operations: I want to get the the sum of the column SStot for each year using
the function by.  The data set is named SS.  I've tried this:
by (SS, year, sum(SStot))
and it's not working.  Is it because there's a different number of rows for each
year?  How else can I do this?
--
Emilie Berthiaume
Graduate student
Biology Departement
Université de Sherbrooke
2500 boul. de l'Université
Sherbrooke, Québec
J1K 2R1 CANADA
Tél: 1-819-821-8000 poste 2059
Fax: 1-819-821-8049
[EMAIL PROTECTED]
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 


--
Dipl. bio-chem. Witold Eryk Wolski 
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin   _
tel: 0049-30-83875219   'v'
http://www.molgen.mpg.de/~wolski   /   \
mail: [EMAIL PROTECTED]  ---W-W
 [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] Is there any way to release memory in running time?

2004-09-30 Thread Witold Eryk Wolski
?gc
/E
[EMAIL PROTECTED] wrote:
Hi all,
I am doing some intensive computation right now. My system is Pentium4 3.20G 
+ 1.0G RAM + WindowsXP + R1.9.1. It seems my computer is very powerful. 
However, when I do some simple matrix algebra operations based on a matrix 
(DD) with dimension 500 by 2, I found that the consumption of RAM is 
huge. For example, the command a - 1 - DD[,2] eats my 100M RAM. Does anyone 
know how to release memory in the middle of program (running time)? BTW, the 
command rm() does not free memory unless you quit R as I as know. Thanks in 
advance.

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


--
Dipl. bio-chem. Witold Eryk Wolski 
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin   _
tel: 0049-30-83875219   'v'
http://www.molgen.mpg.de/~wolski   /   \
mail: [EMAIL PROTECTED]  ---W-W
 [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] add-on packages

2004-09-28 Thread Witold Eryk Wolski
Hi!
install.packages(RMySQL)
^   ^
note the parenthesis
/E
Vikas Rawal wrote:
I want to add RMySQL and RODBC packages to my R installation on redhat 
linux box. The command install.packages gives following output. What 
could be wrong?


trying URL `http://cran.r-project.org/src/contrib/PACKAGES'
Content type `text/plain; charset=iso-8859-1' length 202145 bytes
opened URL
.. .. .. .. ..
.. .. .. .. ..
.. .. .. .. ..
.. .. .. .. ...
downloaded 197Kb
Error in unique(pkgs) : Object RMySQL not found
**
Vikas
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html


--
Dipl. bio-chem. Witold Eryk Wolski 
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin   _
tel: 0049-30-83875219   'v'
http://www.molgen.mpg.de/~wolski   /   \
mail: [EMAIL PROTECTED]  ---W-W
 [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] slow loops in Monte Carlo Simulations

2004-09-28 Thread Witold Eryk Wolski
Hi!
Have you taken a look at the MCMCpack - package on cran:
This package contains functions for posterior simulation for a number 
of statistical models. All simulation is done in compiled C++ written in 
the Scythe Statistical Library Version 1.0. All models return coda mcmc 
objects that can then be summarized using the coda package.

/E
Nael Al Anaswah wrote:
Hi there,
I am running Monte Carlo Simulations in R using ordinary while 
(condition) loops. Since the number of iterations is something like 
100.000 and within each iteration a given subsample is extended 
sequentially it takes hours to run the simulation. 

Does anyone know if there is either a way to avoid using loops in 
Monte Carlo Simulations or how to include possible faster c++ 
commands in R code?

many thanks in advance.
Nael Al-Anaswah

-
Nael Al-Anaswah
Department of Econometrics
University of Muenster
Germany
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 


--
Dipl. bio-chem. Witold Eryk Wolski 
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin   _
tel: 0049-30-83875219   'v'
http://www.molgen.mpg.de/~wolski   /   \
mail: [EMAIL PROTECTED]  ---W-W
 [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] S4 method selection based on second argument

2004-09-28 Thread Witold Eryk Wolski
Hi,
If it's the only reason why you think you have to use S4 then take a 
look at ?missing.
If you are interested in S4:
The first version gives an overview of setMethods. Then I give a simpler 
example. And finally a pure ?missing solution.

A) Declare function repmat as generic
if(!isGeneric(repmat))
setGeneric(repmat
  ,function(obx,oby,obz,...)
  standardGeneric(repmat))
#B = repmat(A, m, n)
setMethod(repmat,signature(obx=numeric,oby=numeric,obz=numeric)
   ,function(obx,oby,obz){print(thre arg call)
   })
#B = repmat(A, [m n])
#B = repmat(A, n)
setMethod(repmat,signature(obx=numeric,oby=numeric,obz=missing)
   ,function(obx,oby)
   {
  print(two arg)
   #handle the difference in oby.
   if(length(oby)==1)
oby
  else
obx
   })
##END A ###
#simpler
#if(!isGeneric(repmat)) #commented out because you have already declared it.
setGeneric(repmat
  ,function(object,...)
  standardGeneric(repmat))
setMethod(repmat,signature(object=numeric)
,function(object,oby,obz)
{
#using ?missing handle the differences.
if(missing(obz))
print(new version)
})
Note that you can have the same in S3 using ?missing
something like this.
repmat - function(A, m, n) {
if(missing(n)
{
if(length(m)==2)
{   
repmat1(A, m[1], m[2])
}
else
kronecker(matrix(1, m, m), A)   
}
kronecker(matrix(1, n, m), A)}
}
/E

Paul Roebuck wrote:
I'm translating some Matlab code and need some help figuring
out how to change this call into an S4 generic method.
In matlab, there's a function called 'repmat' with three
calling sequences (all I have to deal with anyway):
   1) B = repmat(A, m, n)
   2) B = repmat(A, [m n])
   3) B = repmat(A, n)
In all cases, A is the fill value, m is number of rows,
and n is number of columns.
As separate functions, the translations would roughly be:
repmat1 - function(A, m, n) {
   kronecker(matrix(1, n, m), A)
}
 


repmat2 - function(A, rc) {
   repmat1(A, rc[1], rc[2])
}
repmat3 - function(A, n) {
   repmat1(A, n, n)
}
Suggestions?
--
SIGSIG -- signature too long (core dumped)
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 


--
Dipl. bio-chem. Witold Eryk Wolski 
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin   _
tel: 0049-30-83875219   'v'
http://www.molgen.mpg.de/~wolski   /   \
mail: [EMAIL PROTECTED]  ---W-W
 [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] Best device for printing quality

2004-09-23 Thread Wolski
Hi!

I would first check what kind of graphic format the article publisher of the article 
accepts.

If ps/pdf is ok I would use ?postscript. Otherwise I would change the journal.

/E

*** REPLY SEPARATOR  ***

On 9/24/2004 at 11:12 AM javier garcia - CEBAS wrote:

Hi all;
Just to ask you for your advise about what is the best way to get the
best 
quality for graphics to be incorporated into a printed article

(I'm mainly a Linux useR, but also use the windows R version)

Thanks and best regards,

Javier Garcia

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



Dipl. bio-chem. Witold Eryk Wolski @ MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin'v'
tel: 0049-30-83875219/   \   
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski 
  [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] How to plot residuals vs. fitted of trgls object (spatial::surf.gls)

2004-09-21 Thread Wolski
Hi!

Would like to to make a plot of residuals vs. fitted and Y vs. predicted values   from 
an object of class trgls as returned by spatial::surf.gls directly.
(without calling spatial::predict.trgls)
Is it possible? on which list components should I look at?

/E

__
[EMAIL PROTECTED] 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] persiting complex R objects

2004-09-20 Thread Wolski
Hi!
?save
'save' writes an external representation of R objects to the
 specified file.  The objects can be read back from the file at a
 later date by using the function 'load' (or 'data' in some cases).


?load 

   Reload the datasets written to a file with the function 'save'.


/E
*** REPLY SEPARATOR  ***

On 9/20/2004 at 12:00 PM Richard Mott wrote:

Is there a method to save a large and complex R object (either as a 
binary or text file) so that it can be loaded and reused at a later 
time? Specifically, I am creating large lists (several thousand 
elements), each element of which is either a vector or a matrix (with ~ 
2000 rows). The dimensions of the matrices are not all the same. My 
ideal would be a set of functions of the form

obj - create() # computes  the object
save(obj,filename)
obj - load(filename)

-- 

Richard Mott   | Wellcome Trust Centre 
tel 01865 287588   | for Human Genetics
fax 01865 287697   | Roosevelt Drive, Oxford OX3 7BN

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



Dipl. bio-chem. Witold Eryk Wolski @ MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin'v'
tel: 0049-30-83875219/   \   
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski 
  [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] Multiple operations on list

2004-09-20 Thread Wolski
Hi!

Not sure if I got your point. 
But if it is to compute apply a function
to all pairs (x1,x2);(x1,x3);(x2,x3) where x1,x2,x3 are stored in a list you can take 
look at the sources 
of  function listdist which computes an object of class dist from a list, in the 
package pairseqsim available from bioconducor, to get an idea how to do this.

/E

*** REPLY SEPARATOR  ***

On 20.09.2004 at 13:24 Stephane DRAY wrote:

Hello,

suppose I have a list with matrices:

a=list(x1=matrix(rnorm(10),5,2),x2=matrix(rnorm(10),5,2),x3=matrix(rnorm(10),5,2))

I want to compute for all combination of xi and xj (x1,x2 x1,x3 and x2,x3) 
a value.
This value is given for the pair x1,x2 by trace(x1%*%t(x1)%*%x2%*%t(x2)) / 
trace(x1%*%t(x1))*trace(x2%*%t(x2))

I know that product matrices t(xi)%*%xi can be obtained by:

aa=lapply(a,crossprod)

but I do not know how to mix the values in aa to obtain the desired
values.

Is there a way to do it without for loop ?

Thanks in advances,

sincerely

Stéphane DRAY
--
 

Département des Sciences Biologiques
Université de Montréal, C.P. 6128, succursale centre-ville
Montréal, Québec H3C 3J7, Canada

Tel : (514) 343-6111 poste 1233 Fax : (514) 343-2293
E-mail : [EMAIL PROTECTED]
--
 

Web 
http://www.steph280.freesurf.fr/

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

__
[EMAIL PROTECTED] 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] Conditionally swap two columns of a data.frame?

2004-09-16 Thread Wolski
Hi!
Better then a cookbook.
http://www.ku.edu/~pauljohn/R/Rtips.html

/E
Ps.


*** REPLY SEPARATOR  ***

On 9/16/2004 at 1:55 PM Dan Bolser wrote:

Minter!

Is there an R cookbook? which lists this kind of common problem and
common
solution?


On Thu, 16 Sep 2004, Dimitris Rizopoulos wrote:

Hi Dan,

do you need something like that,

dat - data.frame(V1=rnorm(4, 10), V2=rnorm(4, 10))
ratioV1V2 - ifelse(dat$V1dat$V2, dat$V1/dat$V2, dat$V2/dat$V1)

I hope it helps.

Best,
Dimitris


Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/396887
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
 http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm

- Original Message - 
From: Dan Bolser [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 16, 2004 2:19 PM
Subject: [R] Conditionally swap two columns of a data.frame?



 I am doing this a kinda dumb way, and it is apparetnly taking
 forever.

 I have a data frame with two numeric columns. I want to look at
their
 correlation, and I am looking at the size ratio between the two.

 i.e.

 plot(density(data$V1/data$V2))

 This kinda gives me a normal curve showing something about the
 distribution of the two values.

 I want to make sure that V1/V2 is always  1 ...

 for (i in 1:length(row.names(data)) ){
   ratioV1V2 - if(V1V2) V1/V2 else V2/V1
 }

 This is a bit of a hack, and is taking forever for some reson (about
 40,000 rows in my data.frame).

 I would just like to swap the values in the data frame (to put the
bigest
 first for example), then use the above plot to get what I want.

 Should I use the DB backend to the data to make the dump in this
way?
 (involves some hacky sql)

 Considering I am interested in the range of the ratio between V1 and
V2,
 should I be looking at doing a different analysis?

 I am so dumb, any help is appreciated,

 Dan.

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



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



Dipl. bio-chem. Witold Eryk Wolski @ MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin'v'
tel: 0049-30-83875219/   \   
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski 
  [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] Multi-dimensional scaling

2004-09-16 Thread Wolski
See:

www.r-project.org - Documentation-Newsletter-Volume 3/3, December 2003

There is an artikle by Jonathan Edwards and Paul Oman
Dimensional Reduction for Data Mapping

/E


*** REPLY SEPARATOR  ***

On 9/16/2004 at 3:28 PM Luis Rideau Cruz wrote:

R-help,

Is there any package/function in R which can perform multi-dimensional
scaling?

Thank you in advance

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



Dipl. bio-chem. Witold Eryk Wolski @ MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin'v'
tel: 0049-30-83875219/   \   
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski 
  [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] Density Estimation

2004-09-15 Thread Wolski
Hi!

The function density returns you a object of class density.
This object has an x and an y attribute which you can access by x y,
Hi!

Use approx and runif.

eg.:

dd-density(rnorm(100,3,5))
plot(dd)

Using the function ?approx you can compute the density value for any x.
#the x is a dummy here.
mydist-function(x,dd)
{

while(1)
{
tmp - runif(1,min=min(dd$x),max=max(dd$x))
lev - approx(dd$x,dd$y,tmp)$y
if(runif(1,c(0,1)) = lev)
{
return(tmp)
}
}
}

x - 0
mydist(x,dd)

res-rep(0,500)
res-sapply(res,mydist,dd)
lines(density(res),col=2)


/E.



*** REPLY SEPARATOR  ***

On 9/15/2004 at 12:36 PM Brian Mac Namee wrote:

Hi there,

Sorry if this is a rather loing post. I have a simple list of single
feature data points from which I would like to generate a probability
that an unseen point comes from the same distribution. To do this I am
trying to estimate the probability density of the list of points and
use this to generate a probability for the new unseen points. I have
managed to use the R density function to generate the density estimate
but have not been able to do anything with this - i.e. generate a
rpobability that a new point comes from the same distribution. Is
there a function to do this, or am I way off the mark using the
density function at all?

Thanks in advance,

Brian.

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



Dipl. bio-chem. Witold Eryk Wolski @ MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin'v'
tel: 0049-30-83875219/   \   
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski 
  [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] erase columns

2004-09-14 Thread Wolski
?subset

/E
*** REPLY SEPARATOR  ***

On 9/14/2004 at 10:44 AM michele lux wrote:

Can somebody remember me which is the command to erase
columns from a data frame?
Thanks Michele


 
___

http://it.seriea.fantasysports.yahoo.com/

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



Dipl. bio-chem. Witold Eryk Wolski @ MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin'v'
tel: 0049-30-83875219/   \   
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski 
  [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] Sweave echoing comments (again)

2004-09-08 Thread Wolski
Hi!

I observed it also. There are cases where it is not desirable. It will be quite 
helpfull, if possible, to have a parameter that allows one to switch of removing the 
#comments. 

/E

*** REPLY SEPARATOR  ***

On 9/6/2004 at 1:30 PM Thomas Petzoldt wrote:

Hello,

I try to document some R scripts for my collegues and observed the 
problem, that Sweave strips comment lines away.

As a small example I write in an Rtex file:

\begin{Scode}
## a small example
test() # line comment
\end{Scode}

... the .tex file generated by Sweave only contains:

\begin{Schunk}
\begin{Sinput}
  test()
\end{Sinput}
\end{Schunk}


... and all the comments are lost. Looking into the archives, I found, 
that such a question appeared already some months ago. Are there any 
advances or workarounds doing such things today?

Thank you in advance!

Thomas P.

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



Dipl. bio-chem. Witold Eryk Wolski @ MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin'v'
tel: 0049-30-83875219/   \   
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski 
  [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] using text on the x axis ticks rather than numbers

2004-09-07 Thread Eryk Wolski
Hi!
first supress axis drawing with param axes=FALSE in your plot function.
The use axis function to add your axes.
?axis

/E

On Tue, 7 Sep 2004, Rajarshi Guha wrote:

 Hello,
   is there a way in which I can use text labels rather than numbers on
 the x axis ticks? I basically have a vector of (say) 8 points and I want
 to plot these sequentially. Thus the x axis would have ticks at 1 .. 8.
 Rather than having the labels 1 .. 8 I would like to have some arbitrary
 text labels.

 Ideally I would like the labels to be rotated (say at 45 degrees) so
 that they don't overlap with each other.

 Is this possible?

 Thanks,

 ---
 Rajarshi Guha [EMAIL PROTECTED] http://jijo.cjb.net
 GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
 ---
 Breadth-first search is the bulldozer of science.
 -- Randy Goebel

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


__
[EMAIL PROTECTED] 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] substitution in expression

2004-09-06 Thread Wolski
Hi!

plot(1:10, main=expression(paste( x, , Delta,  values )))

/E



*** REPLY SEPARATOR  ***

On 9/6/2004 at 3:50 PM Adaikalavan Ramasamy wrote:

I have been struggling with this problem for a while and I hope
someone
could help me. Or if someone could point me to a section in the manual I
would be grateful.

 x - my
 plot(1:10, main=expression(paste( x, Delta, values )))

Q : How do I get the title to say my (triangle symbol) values ?


The following trial-and-error produced mainly errors :

 plot(1:10, main=expression(paste( get(x), Delta, values ))) 
 plot(1:10, main=expression(paste( substitute(x), Delta, values )))
 plot(1:10, main=expression(paste( deparse(x), Delta, values )))
 plot(1:10, main=paste(x, expression(Delta), values))
 plot(1:10, main=paste(x, eval(expression(Delta)), values))
 plot(1:10, main=paste(x, expression(Delta, values )))
 plot(1:10, main=paste(x, expression(paste(Delta, values 

Many thanks.

Regards, 
-- 
Adaikalavan Ramasamy[EMAIL PROTECTED]
Centre for Statistics in Medicine   http://www.ihs.ox.ac.uk/csm/
Cancer Research UK  Tel : 01865 226 677
Old Road Campus, Headington, Oxford Fax : 01865 226 962

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



Dipl. bio-chem. Witold Eryk Wolski @ MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin'v'
tel: 0049-30-83875219/   \   
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski 
  [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] substitution in expression

2004-09-06 Thread Wolski
Hi!

Sorry for the previous mail.
Take a look at parse.

?parse
x-my
plot(1:10, main=parse(text=x))

Eryk.

*** REPLY SEPARATOR  ***

On 9/6/2004 at 3:50 PM Adaikalavan Ramasamy wrote:

I have been struggling with this problem for a while and I hope
someone
could help me. Or if someone could point me to a section in the manual I
would be grateful.

 x - my
 plot(1:10, main=expression(paste( x, Delta, values )))

Q : How do I get the title to say my (triangle symbol) values ?


The following trial-and-error produced mainly errors :

 plot(1:10, main=expression(paste( get(x), Delta, values ))) 
 plot(1:10, main=expression(paste( substitute(x), Delta, values )))
 plot(1:10, main=expression(paste( deparse(x), Delta, values )))
 plot(1:10, main=paste(x, expression(Delta), values))
 plot(1:10, main=paste(x, eval(expression(Delta)), values))
 plot(1:10, main=paste(x, expression(Delta, values )))
 plot(1:10, main=paste(x, expression(paste(Delta, values 

Many thanks.

Regards, 
-- 
Adaikalavan Ramasamy[EMAIL PROTECTED]
Centre for Statistics in Medicine   http://www.ihs.ox.ac.uk/csm/
Cancer Research UK  Tel : 01865 226 677
Old Road Campus, Headington, Oxford Fax : 01865 226 962

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



Dipl. bio-chem. Witold Eryk Wolski @ MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin'v'
tel: 0049-30-83875219/   \   
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski 
  [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] Standard correlation

2004-09-03 Thread Wolski
Hi!

?scale
?var
?cov

/E



*** REPLY SEPARATOR  ***

On 9/3/2004 at 2:20 PM michael watson (IAH-C) wrote:

OK I better clarify what I mean as it appears it may not be a standard
test.

The pearson correlation coefficient, in laymans terms, uses the shape of
a curve around that curve's average to compare two curves.  The standard
correlation coefficient measures the shape of a curve around zero, and
uses that to compare the two curves.

Therefore a measure that starts at 1 and increases away from zero, and a
measure that starts at -4 and increases towards zero, will be deamed
similar via pearson's correlation coefficient, and dissimilar via the
standard correlation coefficient.  This is useful when increase away
from zero is very different behaviour from increase towards zero.

There are some descriptions here:

http://ccgb.umn.edu/support/software/gspring/HelpPages/GSUM-120.html
http://www.optimaldesign.com/AMHelp/HowTo/HowToChooseClustParam.htm

-Original Message-
From: Stefan Drees [mailto:[EMAIL PROTECTED] 
Sent: 03 September 2004 14:03
To: [EMAIL PROTECTED]
Cc: michael watson (IAH-C); Stefan Drees
Subject: Re: [R] Standard correlation


On Fri, Sep 03, 2004 at 01:30:36PM +0100 - a wonderful day 
 - michael watson (IAH-C) wrote:
 Is there a function for computing the standard correlation
 coefficient (not pearson) in R?
help (cor) yields the following in my R 1.9.1 installation:

...
cor(x, y = NULL, use = all.obs,
  method = c(pearson, kendall, spearman))
...


HTH,
Stefan.
-- 
.o. e-mail: [EMAIL PROTECTED], web: www.sdrees.org, +49 700 SDREESDE ..o
fingerprint = 516C C4EF 712A B26F 15C9  C7B7 5651 6964 D508 1B56 ooo
stefan drees  -  consulting and lecturing  -  problems to tasks

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



Dipl. bio-chem. Witold Eryk Wolski @ MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin'v'
tel: 0049-30-83875219/   \   
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski 
  [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] Accesing the name of an assigned object in a function

2004-09-01 Thread Eryk Wolski
?assign

/E

On Wed, 1 Sep 2004, Henrik Andersson wrote:

 I want to use the name that I assign to an object in the function that
 produces the output, somewhat like below:

 stupid.function - function(input){
   [body]
   cat(Summarized output is , output$summary, Full output is   
  given
 by typing, assigned.name, \n)
   }

 assigned.name - stupid.function(whatever)


 or another example is a function that sinks the results to a text file
 and names it assigned.name.txt .

 I checked the help for function, -, assign but could not find it, is it
   possible ?


 -
 Henrik Andersson
 Netherlands Institute of Ecology -
 Centre for Estuarine and Marine Ecology
 P.O. Box 140
 4400 AC Yerseke
 Phone: +31 113 577473
 [EMAIL PROTECTED]
 http://www.nioo.knaw.nl/ppages/handersson

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


__
[EMAIL PROTECTED] 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] (no subject)

2004-08-31 Thread Wolski
sum(x=7)/length(x)*100


*** REPLY SEPARATOR  ***

On 8/31/2004 at 8:16 AM Paolo Tommasini wrote:

Hi this is a very simple question ! if a have a set of date like
x=c(1,2,3,4,4,5,6,8,7,8,8)

how can I find out the percentile of 7 ?

thanks

Paolo

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



Dipl. bio-chem. Witold Eryk Wolski @ MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin'v'
tel: 0049-30-83875219/   \   
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski 
  [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] blockwise sums

2004-08-31 Thread Wolski
Hi!

ind-c(sort(rep(1:floor(length(x)/ 3 ) ,  3 )) , floor(length(x)/ 3 )+1)



by(x,ind,sum)

my.blockwisesum-function(x,n,...)
{
ind-c(sort(rep(1:floor(length(x)/ n ) ,  n )) , floor(length(x)/ n )+1)
return(tapply(x,ind,sum))
}


/Eryk


*** REPLY SEPARATOR  ***

On 8/31/2004 at 2:19 PM Lutz Prechelt wrote:

I am looking for a function like 
  my.blockwisesum(vector, n)
that computes sums of disjoint subsequences of length n from vector
and can work with vector lengths that are not a multiple of n.

It should give me for instance
  my.blockwisesum(1:10, 3) == c(6, 15, 24, 10)

Is there a builtin function that can do this?
One could do it by coercing the vector into a matrix of width n,
and then use apply,
but that is cumbersome if the length is not divisible by n, 
is it not?
Any other ideas?

  Lutz

Prof. Dr. Lutz Prechelt;  [EMAIL PROTECTED]
Institut fuer Informatik; Freie Universitaet Berlin
Takustr. 9; 14195 Berlin; Germany
+49 30 838 75115; http://www.inf.fu-berlin.de/inst/ag-se/

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



Dipl. bio-chem. Witold Eryk Wolski @ MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin'v'
tel: 0049-30-83875219/   \   
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski 
  [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] More efficient matrix computation

2004-08-31 Thread Wolski
Hi!
apply(m,2,quantile,c(0.95,0.99))
/Eryk

*** REPLY SEPARATOR  ***

On 8/31/2004 at 9:16 AM JTW wrote:

I have a 20x3 matrix as follows:

 m - replicate(3, matrix(rnorm(20),20,1))

I need to compute, say, 95th and 99th percentiles of
each column such that the resulting matrix becomes 2x3
with each row representing the respective percentile. 
My best effort is to compute one column at a time as
follows:

 quantile(m[,1], c(0.95, 0.99))

To do the same for columns 2 and 3, I would simply
change the column number accordingly.  Clearly, this
is not very efficient as I may have a large matrix
(e.g., 100,000x500) to work with.  Any help with the
code is appreciated.

Jack Wang

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



Dipl. bio-chem. Witold Eryk Wolski @ MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin'v'
tel: 0049-30-83875219/   \   
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski 
  [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] Sparse Matrices in R

2004-08-31 Thread Wolski
Hi!
help.search(sparse matrix)


graph2SparseM(graph)Coercion methods between graphs and sparse
matrices
tripletMatrix-class(Matrix)
Class tripletMatrix sparse matrices in
triplet form
SparseM.hb(SparseM) Harwell-Boeing Format Sparse Matrices
image,matrix.csr-method(SparseM)
Image Plot for Sparse Matrices
etc .

/E

*** REPLY SEPARATOR  ***

On 8/31/2004 at 5:52 PM Danny Heuman wrote:

I have data in i,j,r format, 



where r is the value in location A[i,j] for some imaginary matrix A.

I need to build this matrix A, but given the sizes of i and j, I believe
that using a sparse format would be most adequate.

Hopefully this will allow me to perform some basic matrix manipulation
such as multiplication, addition, rowsums,  transpositions, subsetting
etc etc.



Is there any way to achieve this goal in R?
Thanks,
 
Danny

 [[alternative HTML version deleted]]

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



Dipl. bio-chem. Witold Eryk Wolski @ MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin'v'
tel: 0049-30-83875219/   \   
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski 
  [EMAIL PROTECTED]

__
[EMAIL PROTECTED] 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] About passing parameter to '.R' script file

2004-08-27 Thread Wolski
Hi!

You can do it indirectly e.g within a batch file.

a) set an envirovment variable (the path to the file)
b) access it from within you *.R script using ?Sys.getenv

Hope it helps.
Eryk

*** REPLY SEPARATOR  ***

On 8/27/2004 at 4:36 PM Kishore, Tapake wrote:

Hi,

I am trying the 'R' application for generating the data for the uploaded
'.gpr' file. I have written script file named 'test.R'. Currently i have
hardcoded the path of uploaded '.gpr' file in the script itself. 

I would like to know how to pass a command line parameter to the
'test.R' script file, so that i dont have to hardcode the path and
filename of the '.gpr' files.
Also, need to access these parameters inside the script file to use the
path of the uploaded file.
I am using below command to invoke the 'R' application by using the
'test.R' script file.

e.g.
c:\\R\\rw1091\\bin\\R.exe CMD BATCH c:\\R\\rw1091\\bin\\test.R

Expecting your suggestion on this.

Thanks in advance.

Regards,
Kishore

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



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

__
[EMAIL PROTECTED] 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] for (i in ...) { df[[i]]- .....}

2004-08-27 Thread Wolski
?do.call

do.call(cc,cbind)

Hope it helps

Eryk



*** REPLY SEPARATOR  ***

On 8/27/2004 at 2:11 PM Luis Rideau Cruz wrote:

R-help,

In the following loop :

for(i in 1:8)
{
cc[[i]]-tapply(test[,i+6],list(puntar=test$puntar),sum)/tapply(test[,5],list(puntar=test$puntar),sum)

cbind.data.frame(cc[[1]],cc[[2]],cc[[3]],cc[[4]],
cc[[5]],c[[6]],cc[[7]],cc[[8]])

}

Is there anyway I can 'cbind.data.frame' the objects cc[[ i ]] without
actually writing every single element??
In this case there are 8 but what if it is a large number??


Thank you

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



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

__
[EMAIL PROTECTED] 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] Running R from CD?

2004-08-27 Thread Wolski
Hi!

Make a isntallation of R on a PC where it is allowed. Install all packages you need. 
Burn the installation folder (rw1091) on the CD.
Start R by clicking on Rgui.exe in the bin folder (rw1091/bin).
Or set a path on the command line to (CD drive letter) :\rw1091\bin
Or create a shortcut.
This should work.

Hope it helps.
Eryk

Ps. If you need to install afterwards package you have to set R_LIBS to a writable 
drive.



*** REPLY SEPARATOR  ***

On 8/27/2004 at 3:54 PM Hans van Walen wrote:

At work I have no permission to install R. So, would anyone know
whether it
is possible to create a CD with a running R-installation for a
windows(XP)
pc? And of course, how to?

Thank you for your help,
Hans van Walen

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



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

__
[EMAIL PROTECTED] 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] relative frequencies for hist()

2004-08-21 Thread Wolski
Hi!

d$counts/length(a)


And of course you can if it is what you want.

d$density-d$counts/length(a)
plot(d,freq=F)


Sincerely Eryk


*** REPLY SEPARATOR  ***

On 8/21/2004 at 7:10 PM Steffen Katzner wrote:

I have problems getting a histogram with relative frequencies on the
y-axis.

Here is an example data set:

  a - c(4.626, 4.627, 4.627, 4.628, 4.629, 4.629, 4.630, 4.631, 4.632, 
 4.632)
  d = hist(a,freq=F)
  d$density
[1] 299. 100. 200. 100. 100. 200.

The obtained densities are given by counts/(total n * bin width), with 
bin width being 0.001 in this case.

Is there any way to get a histogram with relative frequencies 
irrespective of bin width, i.e. counts/total n ? It doesn't seem to work 
for truehist() either.

Thanks.
Steffen

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



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

__
[EMAIL PROTECTED] 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] lapply drops colnames

2004-08-02 Thread Wolski
Hi!

The (column) - names are a property of the data.frame (list - from which data.frame 
inherits (at least theoretically (green book) how it is implemented in R I do not 
know.) The columns of the data.frame are lists again. The data.frama is the box and a 
column is a list in the data.frame list. lapply is working on list elements. The 
column list does not know anything about the list (data.frame) in which it is stored. 
Hence, it does not know also the name (index) at which it is stored. lapply is 
iterating through this container
 not randomly.
What you can do is to extend the column (list) by an addtional attribute  
attr(mydataframe[i],info)-names(mydataframe)[i] and store theyr names in it.
After you have done it you can

lapply(a, function(x) {print(attr(x,info))})

Hope it helps.

Eryk


*** REPLY SEPARATOR  ***

On 8/2/2004 at 5:03 PM Jack Tanner wrote:

I want to iterate over a data frame by columns, and as I'm processing 
each column I want to know its column name.

  a - as.data.frame(list(1,2,3))
  colnames(a) - c(a, b, c)
  colnames(a)
[1] X1 X2 X3
  lapply(a, function(x) {print(colnames(x))})
NULL
NULL
NULL
$a
NULL

$b
NULL

$c
NULL

What is lapply doing? Why does it drop the column name of every column 
it's iterating over? How can I get the column name as a string?

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



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


[R] Comparing correlated (paired) ROC curves (sensitivities).

2004-07-29 Thread Wolski
Hi!


I am looking for functions which I can use to compare correlated ROC curves, or even 
better correlated (paired - obtained from the same data with different measures) 
sensitivities given FP rates.


Eryk


Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


[R] as(obj,matrix)

2004-07-28 Thread Wolski
Hi!

Here a simple example.

setClass(myclass
,representation(info=character)
,contains=matrix
)

rownames(dd)-c(a,b)
tt-new(myclass,dd)
#the source of pain.
as(tt,matrix)-matrix(1,3,3) 
Error: length of dimnames [1] not equal to array extent


Is there a different way to do what I would like to do (I would like to change the 
@.Data and all its attributes in the object)?

 
Eryk.

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


Re: [R] as(obj,matrix)

2004-07-28 Thread Wolski

The definition of dd is.
dd-matrix(0,2,2)


*** REPLY SEPARATOR  ***

On 7/28/2004 at 4:12 PM Adaikalavan Ramasamy wrote:

On Wed, 2004-07-28 at 15:55, Wolski wrote:
 Hi!
 
 Here a simple example.
 
 setClass(myclass
 ,representation(info=character)
 ,contains=matrix
 )
 
 rownames(dd)-c(a,b)

Er, I don't think you have defined 'dd' in the example.

 tt-new(myclass,dd)
 #the source of pain.
 as(tt,matrix)-matrix(1,3,3) 
 Error: length of dimnames [1] not equal to array extent
 
 
 Is there a different way to do what I would like to do (I would like
to change the @.Data and all its attributes in the object)?
 
  
 Eryk.
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html




Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


[R] ordering of levels.

2004-07-26 Thread Wolski
Hi!
Have the following factors with the following levels.
 tmp$norm
 [1] rank rank rank rank rank log  log  log  rank sqrt sqrt sqrt log  log  rank
[16] rank rank sqrt sqrt sqrt sqrt log  log  log  log  sqrt none none none none
[31] none none none none sqrt none
Levels: log none rank sqrt

I would like to add an ordering to the levels.
nonesqrtlogrank

I tried with 
tmp$norm -factor(tmp$norm,labels = c(none,sqrt,log,rank),ordered=T)
tmp$norm
 [1] log  log  log  log  log  none none none log  rank rank rank none none log 
[16] log  log  rank rank rank rank none none none none rank sqrt sqrt sqrt sqrt
[31] sqrt sqrt sqrt sqrt rank sqrt
Levels: none  sqrt  log  rank

But this is not what I would like to have because the command not only superimposes an 
ordering but also changes the factors!

Eryk

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


Re: [R] ordering of levels.

2004-07-26 Thread Wolski
Hi!
Thanks a lot.
Eryk

*** REPLY SEPARATOR  ***

On 7/26/2004 at 2:07 PM Sundar Dorai-Raj wrote:

Wolski wrote:

 Hi!
 Have the following factors with the following levels.
  tmp$norm
  [1] rank rank rank rank rank log  log  log  rank sqrt sqrt sqrt log 
log  rank
 [16] rank rank sqrt sqrt sqrt sqrt log  log  log  log  sqrt none none
none none
 [31] none none none none sqrt none
 Levels: log none rank sqrt
 
 I would like to add an ordering to the levels.
 nonesqrtlogrank
 
 I tried with 
 tmp$norm -factor(tmp$norm,labels =
c(none,sqrt,log,rank),ordered=T)
 
tmp$norm
 
  [1] log  log  log  log  log  none none none log  rank rank rank none
none log 
 [16] log  log  rank rank rank rank none none none none rank sqrt sqrt
sqrt sqrt
 [31] sqrt sqrt sqrt sqrt rank sqrt
 Levels: none  sqrt  log  rank
 
 But this is not what I would like to have because the command not only
superimposes an ordering but also changes the factors!
 
 Eryk
 

Eryk,
   See ?factor or ?ordered which will help. I think what you want is:

lev - c(none, sqrt, log, rank)
tmp$norm - ordered(tmp$norm, levels = lev)

or

tmp$norm - factor(tmp$norm, levels = lev, ordered = TRUE)

Note the use of levels and not labels.

--sundar



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


Re: [R] binning a vector

2004-07-26 Thread Wolski
?tapply

*** REPLY SEPARATOR  ***

On 7/26/2004 at 5:11 PM [EMAIL PROTECTED] wrote:

Hello,

I was wondering wether there's a function in R that takes two vectors
(of same length) as input and computes mean values for bins (intervals)
or even a sliding window over these vectros.

I've several x/y data set (input/response) that I'd like plot together.
Say the x-data for one data set goes from -5 to 14 with 12,000 values,
then I'd like to bin the x-vector in steps of +1 and calculate and plot
the mean of the x-values and the y-values within each bin.

I was browsing the R-docs but couldn't find anything appropiate.

 thanks for hints + kind regads,

 Arne

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



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


Re: [R] retrieve rows from frame assuming criterion

2004-07-23 Thread Wolski
?subset

Eryk

*** REPLY SEPARATOR  ***

On 7/23/2004 at 2:36 PM Luis Rideau Cruz wrote:

Hi all,

I have a data frame in which one column(PUNTAR) is of character type.
What I want is to retrieve is the frame but only with those rows
matching elements of PUNTAR with a list characters (e.g c(IX49,IX48)
)

YearTUR  STODNR   PUNTAR
1994  9412 94020061 IX49
1994  9412 94020062 IX48
1994  9412 94020063  X32
1994  9412 94020065  X23
1994  9412 94020066  X27
1994  9412 94020067 XI19
1994  9412 94020068 XI16
1994  9412 94020069 XI14
1994  9412 94020070  XI8
1994  9412 94020071  X25
1994  9412 94020072  X18
1994  9412 94020073 II23
1994  9412 94020074XII33
1994  9412 94020075XII31

my.function(frame) should be then equal to 

Year TURNR   STODNR M_PUNTAR
1994  9412 94020061 IX49
1994  9412 94020062 IX48

Thank you in advance


Luis Ridao Cruz
Fiskirannsóknarstovan
Nóatún 1
P.O. Box 3051
FR-110 Tórshavn
Faroe Islands
Phone: +298 353900
Phone(direct): +298 353912
Mobile: +298 580800
Fax: +298 353901
E-mail:  [EMAIL PROTECTED]
Web:www.frs.fo

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



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


[R] biplot identify

2004-07-22 Thread Wolski
Hi!

Is there a way to get biplot and identify to work togheter.

Having the output of prcomp I would like to draw a biplot that.
Instead of plotting the sample (row-names) names plots some pch symbols. (thats easy 
with xlabs)

But now I would like to add using identify the names to only some of the points. I 
have noticed that both biplot.prcomp and biplot.default does a lot of scaling.

So has anyone a function like identify.prcomp please?


Is it possible?

Sincerely
Eryk


Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


[R] 2 images with 2 color scales on one graphic device. How to get it?

2004-07-21 Thread Wolski
Hi!

Would like to plot two image plots with color scale (like levelplot (lattice) 
implements) in one graphic device.
Tried to plot 2 levelplot's (lattice) (the data has not much in common) in one 
graphics device by setting par(mfrwo=c(2,1)) which does not work.

Is there a way to force levelplot to use only a half of the graphic device?
Is there a function like image which provides the color scale and is working with 
par(mfrow, mfcol?


Eryk



 

Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


Re: [R] Sort a data frame

2004-07-20 Thread Wolski
Hi

Lets assign your data frame to the variable yourdf
then:

yourdf[ , order( yourdf$year ) ]

should sort it.

For decreasing increasing sorting
see 
?order

Sincerely Eryk.



*** REPLY SEPARATOR  ***

On 20.07.2004 at 09:51 Luis Rideau Cruz wrote:

Hi all 

I have the next data frame 

year   STODSLAGNR  TAL TALT   TALVEKT
1 2002  2120006 57  1  NA  1
2 1997  9703003257 NA   NA  NA
3 1997  9703007127 1  NA  NA
4 1997  9703000557 1  NA  NA
5 1997  9702012760 NA   1 NA
6 2001  1160025 27  1  NA  1
7 1998  9802006960 1  NA  NA
8 1996  9603000957 NA   1 NA

How to sort it according to year column
Sort does seem to work only on vectors

Thank you

Luis Ridao Cruz
Fiskirannsóknarstovan
Nóatún 1
P.O. Box 3051
FR-110 Tórshavn
Faroe Islands
Phone: +298 353900
Phone(direct): +298 353912
Mobile: +298 580800
Fax: +298 353901
E-mail:  [EMAIL PROTECTED]
Web:www.frs.fo

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

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


Re: [R] vectorizing a matrix computation

2004-07-20 Thread Wolski
Hallo Christoph!

Using apply and sweep.
Both of them accept  as the second argument (MARGIN) a vector which specifies the 
dimension.

?apply
?sweep.

To specify the subscripts accurately I always need some trials, and to run tests, so I 
cant you provide with the final solution.

Hope it helps anyway.

Sincerely Eryk.



*** REPLY SEPARATOR  ***

On 7/20/2004 at 11:31 AM Christoph Lehmann wrote:

Dear R users

I have a 4-dimensional matrix (actually several 3d (x,y, slices) 
matrices appended over time (volumes))

say, e.g. I want to z-transform the data (subtract the mean and divide 
by the std-deviation)

for (slice in 1:slices) {
 for (x in 1:x.dim) {
 for (y in 1:y.dim) {
 t - as.matrix(my.matrix[x,y,slice,1:volumes])
 for (vol in 1:volumes) {
 my.matrix.transformed[x,y,slice,vol] - 
(my.matrix[x,y,slice,vol] - mean(t))/sqrt(var(t))
 }
 }
 }
}

how can I vectorize such a function using, one of the *apply functions?

many thanks

Cheers

Christoph

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



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


Re: [R] (no subject)

2004-07-14 Thread Wolski
Hello!

It just is not able to find the file as the error message says.
You can check if you are specified the right directory path using dir.

?dir

dir(/Desktop/work/)

I gues you are not.

If you are specifying the full path, precede it with the drive name c:/

Eryk


*** REPLY SEPARATOR  ***

On 7/14/2004 at 10:02 AM Herman, David (NIH/NIMH) wrote:

Hello,
I'm new to R, and I'm having trouble importing a text file
(I'm
on Windows XP)
 
  m - read.table(/Desktop/work/128_L)
Error in file(file, r) : unable to open connection
In addition: Warning message: 
cannot open file `/Desktop/work/128_L'
 
 
do you know why this isn't working?  All I have is a bunch of text files,
each with a single column of about 30,000 rows.
 
thanks

 [[alternative HTML version deleted]]

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



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


Re: [R] variable definition

2004-07-11 Thread Wolski
Hallo!
?assign

z-now
assign(paste(go, z, sep = .) ,10)


Sincerely
Eryk

*** REPLY SEPARATOR  ***

On 7/11/2004 at 10:02 PM Andrew R. Criswell wrote:

Hello All:

This function obviously fails

x - function(z) - 10
x(now)

But is there a way to define the name of a variable through passing a
parameter in a function call?

Thanks,
ANDREW

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



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


Re: [R] Problem with the grep function

2004-07-08 Thread Wolski
Hi!

For exact matches you can use
== or is.element.
To get the indices use which.

e.g. ==

 x-c(a,b,ab)
 x==a
[1]  TRUE FALSE FALSE
 which((x==a)==T)
[1] 1

or

e.g. is.element

 is.element(x,a)
[1]  TRUE FALSE FALSE
 which(is.element(x,a)==TRUE)
[1] 1
 

Sincerely
Eryk


*** REPLY SEPARATOR  ***

On 7/8/2004 at 9:20 AM [EMAIL PROTECTED] wrote:

Let me present to you my problem :

I have a character vector x and I would like to  obtain the indices of
the 
elements of
this vector that yielded exactly a match.

For example,  x=nom, pattern=b, I would to obtain 2 because b is on
the 
second position.

First program :
nom - c(a,b,ab)
grep(b,nom)
2 3

Then I try the option extended =FALSE (instead of TRUE by default) and I 
obtain '2 3' a second time.

Please can you help me : How can I obtain only 2 in using the grep
function 
(without using the match function).

Thanks you

Julie AUBERT

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



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


Re: [R] Problem with the grep function

2004-07-08 Thread Wolski

Or you must mark the word beginning with ^ and the end $ if you like to use grep.

grep(^b$,nom)


Sincerely
Eryk


*** REPLY SEPARATOR  ***

On 7/8/2004 at 9:20 AM [EMAIL PROTECTED] wrote:

Let me present to you my problem :

I have a character vector x and I would like to  obtain the indices of
the 
elements of
this vector that yielded exactly a match.

For example,  x=nom, pattern=b, I would to obtain 2 because b is on
the 
second position.

First program :
nom - c(a,b,ab)
grep(b,nom)
2 3

Then I try the option extended =FALSE (instead of TRUE by default) and I 
obtain '2 3' a second time.

Please can you help me : How can I obtain only 2 in using the grep
function 
(without using the match function).

Thanks you

Julie AUBERT

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



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


[R] Vertical text in plot

2004-07-02 Thread Wolski
Hallo!
Would like to add vertical text labels to a histogram. Was trying with las but without 
sucess.
I am using the standard histogram.
This is what I was trying.

hist(resS2$sam,breaks=seq(0,1,0.01),col=3,border=0,freq=F,add=T,xlim=c(0,1))
text(quantile(resS2$dif,0.005),5, 0.5% FP rate ,pos=2,cex=0.6,las=2)

Thanks in advance.
Eryk

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


Re: [R] Vertical text in plot

2004-07-02 Thread Wolski
Hi Mark!

Just wonderfull. 
Was searching in the par documention file for vertical, angle, horizontal. The word 
rotation was out of my mind.
Thanks a lot.

Eryk



*** REPLY SEPARATOR  ***

On 7/2/2004 at 12:52 PM Marc Schwartz wrote:

On Fri, 2004-07-02 at 12:45, Wolski wrote:
 Hallo!
 Would like to add vertical text labels to a histogram. Was trying with
las but without sucess.
 I am using the standard histogram.
 This is what I was trying.
 

hist(resS2$sam,breaks=seq(0,1,0.01),col=3,border=0,freq=F,add=T,xlim=c(0,1))
 text(quantile(resS2$dif,0.005),5, 0.5% FP rate ,pos=2,cex=0.6,las=2)
 
 Thanks in advance.
 Eryk


Hi Eryk!

Try using 'srt' instead of 'las', which is for the axis labels.

For example:

text(quantile(resS2$dif, 0.005), 5, 0.5% FP rate, 
 pos = 2, cex = 0.6, srt = 90)

See ?par for more information.

HTH,

Marc Schwartz

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



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


Re: [R] RMySQL

2004-07-01 Thread Wolski
Hi!
I was installing RMySQL quite recently on Linux and had some troubles which I was able 
to solve. So maybee I can help you.
But first I have to know what error messages you are getting on which operating system 
you are installing, which version of the package.

Sincerely Eryk



*** REPLY SEPARATOR  ***

On 01.07.2004 at 13:14 Talita Leite wrote:

Hi!!

I want some help to install the RMySQL package. I've tried to configure
some 
things but i'm still getting erros. Anybody could help me??

Thank's



Talita Perciano Costa Leite
Graduanda em Ciência da Computação
Universidade Federal de Alagoas - UFAL
Departamento de Tecnologia da Informação - TCI
Construção de Conhecimento por Agrupamento de Dados - CoCADa

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

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


Re: [R] Question about mesurating time

2004-06-30 Thread Wolski
?system.time



*** REPLY SEPARATOR  ***

On 30.06.2004 at 10:59 zze-PELAY Nicolas FTRD/DMR/BEL wrote:

Hello , 
Is there any function to mesurate the duration of a procedure (like tic
and toc in matlab) ?

Tic
Source(procedure.R)
Toc

(toc is the duration between the execution of tic and the execution of
toc)

Thank you

nicolas

   [[alternative HTML version deleted]]

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

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


[R] camberra distance?

2004-06-29 Thread Wolski
Hi!

Its not an R specific question but had no idea where to ask elsewhere.

Does anyone know the orginal reference to the CAMBERA  DISTANCE?

Eryk.

Ps.:
I knew that its an out of topic question (sorry).
Can anyone reccomend a mailing list where such questions are in topic?

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


RE: [R] camberra distance?

2004-06-29 Thread Wolski
Thanks Mark.

Yes I mean canberra. 

Searching for canberra camberra by google I observed the following.
Searching for caMberra you will find a paper from 1997 where they write camberra 
instead of canberra dissimilarity for the meassure defined sum(|x_i - y_i| / |x_i + 
y_i|). Meanwhile there are plenty of articles on the net which  reference this paper 
from 1997 and write caMberra instead of canberra.  
May be because it is much harder to find an article about canberra distance using 
google (because of the city). 
A quite assertive argument to use distinctive names and to publish papers in journals 
which are free, online and can be searched by google.


Eryk


*** REPLY SEPARATOR  ***

On 29.06.2004 at 15:51 [EMAIL PROTECTED] wrote:

maybe you mean 'Canberra'?, if so it might have come from work in csiro
in canberra back in the 60's/70's? Look for Lance  Williams 1967 ,
possibly. Aust. Comput. J. 1, 15-20


Mark Palmer
Environmetrics Monitoring for Management   
CSIRO Mathematical and Information Sciences
Private bag 5, Wembley, Western Australia, 6913
Phone  61-8-9333-6293
Mobile  0427-50-2353
Fax:   61-8-9333-6121
Email: [EMAIL PROTECTED] 
URL:   www.cmis.csiro.au/envir



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Wolski
Sent: Tuesday, 29 June 2004 3:45 PM
To: R Help Mailing List
Subject: [R] camberra distance?


Hi!

Its not an R specific question but had no idea where to ask elsewhere.

Does anyone know the orginal reference to the CAMBERA  DISTANCE?

Eryk.

Ps.:
I knew that its an out of topic question (sorry).
Can anyone reccomend a mailing list where such questions are in topic?

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

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


Re: [R] PAM clustering: using my own dissimilarity matrix

2004-06-29 Thread Wolski
Hi!

If your x is your symmetric matrix containing the distances than cast it to an dist 
object using as.dist.
?as.dist.

Sincerely
Eryk

*** REPLY SEPARATOR  ***

On 29.06.2004 at 18:28 Hans Körber wrote:

Hello,

I would like to use my own dissimilarity matrix in a PAM clustering with 
method pam (cluster package) instead of a dissimilarity matrix created 
by daisy.

I read data from a file containing the dissimilarity values using 
read.csv. This creates a matrix (alternatively: an array or vector) 
which is not accepted by pam: A call

p-pam(d,k=2,diss=TRUE)

yields an error message Error in pam(d, k = 2, diss = TRUE) : x is not 
of class dissimilarity and can not be converted to this class. How can 
I convert the matrix d into a dissimilarity matrix suitable for pam?

I'm aware of a response by Friedrich Leisch to a similar question posed 
by Jose Quesada (quoted below). But as I understood the answer, the 
dissimilarity matrix there is calculated on the basis of (random) data.

Thank you in advance.
Hans

__

/ On Tue, 09 Jan 2001 15:42:30 -0700, /
/ Jose Quesada (JQ) wrote: /

/  Hi, /
/  I'm trying to use a similarity matrix (triangular) as input for 
pam() or /
/  fanny() clustering algorithms. /
/  The problem is that this algorithms can only accept a dissimilarity /
/  matrix, normally generated by daisy(). /

/  However, daisy only accept 'data matrix or dataframe. Dissimilarities /
/  will be computed between the rows of x'. /
/  Is there any way to say to that your data are already a similarity /
/  matrix (triangular)? /
/  In Kaufman and Rousseeuw's FORTRAN implementation (1990), they 
showed an /
/  option like this one: /

/  Maybe you already have correlations coefficients between variables. /
/  Your input data constist on a lower triangular matrix of pairwise /
/  correlations. You wish to calculate dissimilarities between the /
/  variables. /

/  But I couldn't find this alternative in the R implementation. /

/  I can not use foo - as.dist(foo), neither daisy(foo...) because /
/  Dissimilarities will be computed between the rows of x, and this is /
/  not /
/  what I mean. /

/  You can easily transform your similarities into dissimilarities like /
/  this (also recommended in Kaufman and Rousseeuw ,1990): /

/  foo - (1 - abs(foo)) # where foo are similarities /

/  But then pam() will complain like this: /

/   x is not of class dissimilarity and can not be converted to this /
/  class. /

/  Can anyone help me? I also appreciate any advice about other 
clustering /
/  algorithms that can accept this type of input. /

Hmm, I don't understand your problem, because proceeding as the docs
describe it works for me ...

If foo is a similarity matrix (with 1 meaning identical objects), then

bar - as.dist(1 - abs(foo))
fanny(bar, ...)

works for me:

## create a random 12x12 similarity matrix, make it symmetric and set the
## diagonal to 1
/ x - matrix(runif(144), nc=12) /
/ x - x+t(x) /
/ diag(x) - 1 /

## now proceed as described in the docs
/ y - as.dist(1-x) /
/ fanny(y, 3) /
iterations objective
 42.00 3.303235
Membership coefficients:
[,1] [,2] [,3]
1 0.333 0.333 0.333
2 0.333 0.333 0.333
3 0.334 0.333 0.333
4 0.333 0.333 0.333
...

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

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


Re: [R] How to determine the number of dominant eigenvalues in PCA

2004-06-28 Thread Wolski
Hi!

There is a chapter in the book from Härdl about the interpretation of PCs available 
online.
http://www.quantlet.com/mdstat/scripts/mva/htmlbook/mvahtmlframe93.html


About determining the number of dominant eigenvalues is a chapter in book of A. Handl  
(available online but in german.) 
http://www.quantlet.com/mdstat/scripts/mst/html/msthtmlframe56.html

Two references to this topic from this online book.
Cattell, R. B. (1966): The scree test for the number of factors. Multivariate 
Behavioral Research, 1, 245-276 
Kaiser, H. F. (1960): The application of electronic computers to factor analysis. 
Educ. Psychol. Meas., 20, 141-151 



Hope this helps.
Sincerely Eryk



*** REPLY SEPARATOR  ***

On 28.06.2004 at 10:06 Fred wrote:

Dear All,

I want to know if there is some easy and reliable way
to estimate the number of dominant eigenvalues
when applying PCA on sample covariance matrix.

Assume x-axis is the number of eigenvalues (1, 2, ,n), and y-axis is
the 
corresponding eigenvalues (a1,a2,..., an) arranged in desceding order.
So this x-y plot will be a decreasing curve. Someone mentioned using the
elbow (knee) method
to find the point that the maximal curvature of this curve occurs.
The number at this point would be the number of dominant eigenvalues.

But I could not find any reference papers on this idea.
Does anyone has tried this method or knows more details on this?

Thanks for your point.

Fred

   [[alternative HTML version deleted]]

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

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


[R] RMysql installation problem.

2004-06-28 Thread Wolski
Hi!

I am trying to install the RMySQL package.  The installation stops with the following 
error message.

path to mysql is set.
setenv PKG_CPPFLAGS /home/arabidopsis/software/R1.9.1/linux/mysql/include
setenv PKG_LIBS /home/arabidopsis/software/R1.9.1/linux/mysql/lib

R CMD INSTALL RMySQL_0.5-5.tar.gz 
#cut cut.
creating src/Makevars
** libs
gcc -I/home/arabidopsis/software/R1.9.1/linux/lib/R/include 
/home/arabidopsis/software/R1.9.1/linux/mysql/include -I/usr/local/include 
-D__NO_MATH_INLINES -mieee-fp  -fPIC  -g -O2 -c RS-DBI.c -o RS-DBI.o
gcc: cannot specify -o with -c or -S and multiple compilations
make: *** [RS-DBI.o] Error 1
ERROR: compilation failed for package 'RMySQL'
** Removing '/home/arabidopsis/software/R1.9.1/linux/lib/R/library/RMySQL'


Thought this is because R and Mysql are compiled with different compilers.  Because of 
this error I just installed the newest R and mysql from source.
Please help.

Eryk

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


Re: [R] RMysql installation problem. / Problem solved!

2004-06-28 Thread Wolski
It works 

with:
R CMD INSTALL 
--configure-args='--with-mysql-dir=/home/arabidopsis/software/R1.9.1/linux/mysql/' 
RMySQL_0.5-5.tar.gz

dunno why.

Sorry for the annoyance.

Eryk

*** REPLY SEPARATOR  ***

On 28.06.2004 at 19:55 Wolski wrote:

Hi!

I am trying to install the RMySQL package.  The installation stops with
the following error message.

path to mysql is set.
setenv PKG_CPPFLAGS /home/arabidopsis/software/R1.9.1/linux/mysql/include
setenv PKG_LIBS /home/arabidopsis/software/R1.9.1/linux/mysql/lib

R CMD INSTALL RMySQL_0.5-5.tar.gz 
#cut cut.
creating src/Makevars
** libs
gcc -I/home/arabidopsis/software/R1.9.1/linux/lib/R/include
/home/arabidopsis/software/R1.9.1/linux/mysql/include -I/usr/local/include
-D__NO_MATH_INLINES -mieee-fp  -fPIC  -g -O2 -c RS-DBI.c -o RS-DBI.o
gcc: cannot specify -o with -c or -S and multiple compilations
make: *** [RS-DBI.o] Error 1
ERROR: compilation failed for package 'RMySQL'
** Removing '/home/arabidopsis/software/R1.9.1/linux/lib/R/library/RMySQL'


Thought this is because R and Mysql are compiled with different compilers.
 Because of this error I just installed the newest R and mysql from source.
Please help.

Eryk

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

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


Re: [R] Installing on Windows packages build on Unix

2004-06-25 Thread Wolski
Hallo Giovanni!

You have to build a windows package on linux/unix.

cran.r-project.org/doc/contrib/cross-build.pdf

Eryk


*** REPLY SEPARATOR  ***

On 6/25/2004 at 11:10 AM Giovanni Petris wrote:

Hello,

I wanted to share with a colleague a few R functions that I wrote. To
this purpose, I created a small package on my machine (Unix) and
emailed it to her. Now she is having troubles installing the package
on her Windows machine. It seems that on her side, install.packages
looks for a zip file - while I have created a tar.gz file. I tried
to build the package with the --use-zip options but that didn't work. 

Any suggestions?

TIA,
Giovanni

-- 

 __
[  ]
[ Giovanni Petris [EMAIL PROTECTED] ]
[ Department of Mathematical Sciences  ]
[ University of Arkansas - Fayetteville, AR 72701  ]
[ Ph: (479) 575-6324, 575-8630 (fax)   ]
[ http://definetti.uark.edu/~gpetris/  ]
[__]

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



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


[R] Initializing SparseM matrix matrix.csc

2004-06-18 Thread Wolski
Hi!

Would like to initialize a huge matrix.csc (Pacakge SparseM) with all elements 0
and afterwards set a few alements nonzero.
The matrix which I like to allocate is so huge that I can not use 
A - matrix(a,n1,p)
before:
A.csr - as.matrix.csc(A)
because I can not allocate such a huge matrix A.
But I believe that the much more memmory efficient model in case of csc matrix should 
do it for a sparse matrix.


How to do this.
Sincerely Eryk

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


Re: [R] How to order a vector

2004-06-17 Thread Wolski
Hi!
I assume that 2003 2002 are the names of your vector myvector

myvector[order(names(myvector))]

Eryk

*** REPLY SEPARATOR  ***

On 6/17/2004 at 12:10 PM Luis Rideau Cruz wrote:

Hi all

I have a vector like this 

2003 2002 2001 2000 1999 1998 1997 1996 
 106   105  106   106105   106   101   107

How can I get it sorted right(19962003)?

Thank you

Luis Ridao Cruz
Fiskirannsóknarstovan
Nóatún 1
P.O. Box 3051
FR-110 Tórshavn
Faroe Islands
Phone: +298 353900
Phone(direct): +298 353912
Mobile: +298 580800
Fax: +298 353901
E-mail:  [EMAIL PROTECTED]
Web:www.frs.fo

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



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


Re: [R] installing my own package - problems with INDEX

2004-06-15 Thread Wolski
Hi!

If I have similar problem.

I first run R CMD check. Then I change to the directory mypackage.Rcheck where R CMD 
check generated a file mypackage-manual.tex.
Then I try to compile the file using latex by myself. In addition I am using a latex 
error aware editor (texniccenter on windows).
When I have the error pinned down in tex file, its usually quite easy to find the 
corresponding Rd file and then the error in the Rd file.

Sincerely Eryk.


*** REPLY SEPARATOR  ***

On 6/15/2004 at 3:14 AM Pamela Hall wrote:

Hi there;

I am a neophyte to R though I have been messing around with programming
in other languages and environments for some years (my dog's name is
punchcard to give you some idea of how many years).  I have been trying
to make a package and install it, to no avail.  The functions I have
written all work as expected (by me, that is).  But I cannot get the
html help pages to work.  

The failure appears to be in creating the INDEX file.  No matter how
carefully I check all of my *.Rd pages, the error message that I have
unbalanced braces  keeps showing up.  I cannot find any error in
matching braces.  I am using Alpha as the editor, and it identifies
mismatched braces - there are none in the *.Rd file.

Another aspect of this problem is that the INDEX file only contains one
line, that of the first file.  However, the html dir has an index file
(00Index.html) that contains all of the functions I have documented, but
they are all linked to the same identical function web page - the first
one.

Please give me a hint.  There are no mismatched braces as far as I can
tell.  Even when I try to check a single function and its Rd file, I get
the same error message.  And there are no other error messages.  The
package can be attached and the functions work, but the help pages do
not.

I must be doing something really simple, but very wrong.  What are the 5
most common first mistakes some one makes in Rd files?

thanks
-ph

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



Dipl. bio-chem. Eryk Witold Wolski@MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin   'v'
tel: 0049-30-83875219   /   \
mail: [EMAIL PROTECTED]---W-Whttp://www.molgen.mpg.de/~wolski

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


  1   2   >