[R] multiple linear regression with quadratic function

2016-02-23 Thread james.foadi
Dear R community, this is probably a well-known topic to some of you, but I am not well into it and would like some clarifications or even jus some suggestions. I have a quadratic scalar field: F(x,y)=K*exp(-(a*x^2+b*y^2+c*x*y)) I also have a random set of positive x,y values and

[R] correlated events in time series

2012-10-25 Thread james.foadi
Apologies in advance for the basic nature of my question. I've never worked with time series, but I am, at present, dealing with evolution in time of certain scalar quantities. By looking at the plots, scalar quantity vs time, for several of these quantities, I am observing a correlation of

[R] what is used as height in hclust for ward linkage?

2011-12-02 Thread james.foadi
Dear R community, I am trying to understand how the ward linkage works from a quantitative point of view. To test it I have devised a simple 3-members set: G = c(0,2,10) The distances between all couples are: d(0,2) = 2 d(0,10) = 10 d(2,10) = 8 The smallest

[R] sourcing a linux file with system

2011-02-26 Thread james.foadi
Dear R community, I would like to source a file in my linux system to set a few environment variables. I have tried: system(source /home/james/build//ccp4-6.1.13/include/ccp4.setup) and got: sh: source: not found In fact, using Sys.which(source) I get an empty string. How can I source that

[R] cancel hclust at bottom of dendrogram plot

2011-02-04 Thread james.foadi
Dear R community, I can't find the way to eliminate the hclust() print at the bottom of the dendrogram plot (plclust). Can this be done? J Dr James Foadi PhD Membrane Protein Laboratory (MPL) Diamond Light Source Ltd Diamond House Harewell Science and Innovation Campus Chilton, Didcot

Re: [R] rgl and lighting

2010-09-10 Thread james.foadi
Yes. A white cube and all lights off to start with give me what I want. Many thanks! J Dr James Foadi PhD Membrane Protein Laboratory (MPL) Diamond Light Source Ltd Diamond House Harewell Science and Innovation Campus Chilton, Didcot Oxfordshire OX11 0DE Email: james.fo...@diamond.ac.uk

[R] rgl and lighting

2010-09-09 Thread james.foadi
Dear R community (and Duncan more specifically), I can't work out how to make additional light sources work in rgl. Here is the example. First I create a cube and visualize it: cubo - cube3d(col=black) shade3d(cubo) Next I position the viewpoint at theta=0 and phi=30: view3d(theta=0,phi=30)

[R] greek letters in rgl plot3d

2010-07-23 Thread james.foadi
Dear RGL experts, I haven't been able to add greek letters to my rgl plot3d. I have tried expression with no success. Here is the interested bit: library(rgl) cb - cube3d() plot3d(cb,xlab=expression(alpha),ylab=,zlab=,box=FALSE,alpha=0.5) The expression(alpha) appears as alpha, rather than

[R] strange issue with which on seq

2010-06-09 Thread james.foadi
Dear R community, I am puzzled by the following lines: v - seq(-0.5,0.5,by=0.1) v [1] -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 which(v == -0.4) [1] 2 which(v == 0) [1] 6 which(v == 0.1) integer(0) which(v == 0.2) integer(0) which(v == 0.3) integer(0) which(v == 0.4)

[R] summing a large, partitioned data frame

2010-01-25 Thread james.foadi
Dear R community, I'm trying to develop a fast way of summing specific rows of a large data frame. Here is an example of the kind of data frames I'm dealing with: refls H K L M/ISYM BATCH I SIGI 43247 1 0 5 2179 61.44117 2.20553 1040 1 0 5257 6 15.16316

[R] new R package. How to hide data file

2010-01-18 Thread james.foadi
Dear R community, I'm in the process of writing a package. One of the functions reads a whole ascii file, full of data: SYMINFO - scan(/file/full/of/data.txt,what=character,sep=\n,quiet=TRUE) SYMINFO is now an array character with roughly 14000 elements. I thought the best way to use this

[R] question about centroid-linkage (cluster analysis) (2)

2009-12-11 Thread james.foadi
Dear R community, just in case some haven't noticed my previous email. I realize hclust relies on a Fortran routine, but I hoped some of you might exactly know how that Y.hc_c$height is computed. And, thus, explain the anomaly I found. Thank you. J Dr James Foadi PhD Membrane Protein Laboratory

[R] question about centroid-linkage (cluster analysis)

2009-12-10 Thread james.foadi
Dear R community, I would be greatful if somebody could shed light on the following. I have created a set of 6 points to check how centroid agglomeration works in cluster analysis: Y - data.frame(x=c(-1,1,1,-1,10,12),y=c(1,1,-1,-1,0,0)) It is quite intuitive to understand that the last

[R] convex hull for cluster analysis

2009-11-24 Thread james.foadi
Dear R gurus and users, I seem to have problem finding the right tool for plotting convex hulls over 2D plots, after a cluster analysis. In fact I would like to draw a convex hull in 2D for a generic group of points. I found a convhulln, but this doesn't seem to give me a convex hull. Here is

Re: [R] convex hull for cluster analysis

2009-11-24 Thread james.foadi
-Original Message- From: Henrique Dallazuanna [mailto:www...@gmail.com] Sent: Tue 24/11/2009 16:10 To: Foadi, James (Imperial Coll.,RAL,DIA) Cc: r-help@r-project.org Subject: Re: [R] convex hull for cluster analysis Try this: plot(Y) polygon(Y[chull(Y),]) Yes! Lovely! Thanks. J