Walmes Zeviani | 1 Jul 01:14 2011
Picon

Re: Error "singular gradient matrix at initial parameter estimates" in nls

I think that these aren't good initial values. If you do a plot of data and
add a curve, the curve don't approximate the data. Frequently I use
interactive procedures to get good initial values. Using playwith() you can
handle sliders to adjust values and use in nls(), look the following

r <-
c(1.16,1.143,1.109,1.093,1.079,1.066,1.053,1.040,1.027,1.015,1.004,0.994,0.985,0.977)
D <-
c(0.1806551,0.2703113,0.3757225,0.5271811,0.8665835,1.0812568,1.0612762,1.0726612,
       1.167927,1.191092,1.1336938,1.1215107,0.9619603,0.8315467)
names <- c(La,Ce,Pr,Nd,Sm,Eu,Gd,Tb,Dy,Ho,Er,Tm,Yb,Lu)

plot(log(D)~r)
Do <- 0.8; En <- 390; ro <- 1.03
curve(log10(Do)*exp(((-4*pi*En*Na)*((ro/2)*(x-ro)^2+(1/3)*(x-ro)^3))/(R*T)),
add=TRUE)

Na <- 6.0221415*10^23 # Avrogadro's number
T <- 1010             # Temp in K
R <- 8.3144           # Gas constant [J mol^-1 K^-1]

## Brice-Model
bricemod <-
nls(log10(D)~log10(Do)*exp(((-4*pi*En*Na)*((ro/2)*(r-ro)^2+(1/3)*(r-ro)^3))/(R*T)),
                start=list(Do=0.8, En=390, ro=1.03), trace=TRUE)

require(playwith)

start <- list()
playwith(
(Continue reading)

Cody Hamilton | 1 Jul 01:17 2011
Picon

testInstalledBasic

Hello,

I installed R 2.13.0 on a Windows 2003 server.  I downloaded the Rtools213.exe from
http://www.murdoch-sutherland.com/Rtools/ and placed it in the path (C:\Program Files\R\R-2.13.0\bin).

I submitted the following code:

library(tools)
Sys.setenv(LC_COLLATE=C)
testInstalledBasic('basic')

I get the following message in the R Console, which I believe corresponds to a failure of the test:

> library(tools)
> Sys.setenv(LC_COLLATE=C)
> testInstalledBasic('basic')
running strict specific tests
  running code in ‘eval-etc.R’
  comparing ‘eval-etc.Rout’ to ‘eval-etc.Rout.save’ ...[1] 1

Is there something wrong with my install?

Regards,
   -Cody

______________________________________________
R-help <at> r-project.org 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.
(Continue reading)

Levi Waldron | 1 Jul 02:02 2011
Picon

highlighting clusters in a heatmap

I would like to draw horizontal or vertical lines on a heatmap to
highlight the clusters at some specified cut depth of the dendrogram.
As a hacked example, the following code would work if I could set the
coordinates of the top and bottom of the false color image correctly
(ymin and ymax), but the correct values seem to depend on the output
device and its size.  I realize that heatmaps use a 2x2 layout which
makes the coordinate system non-obvious, but the result seems very
difficult to customize.  I would appreciate any suggestions for manual
or pre-made solutions.

Example:

set.seed(2)
x <- matrix(rnorm(1000),ncol=10)  #obviously no real clusters here...

row.hclust <- hclust(dist(x))
row.dendro <- as.dendrogram(row.hclust)

heatmap(x,
        Rowv=row.dendro)
row.cut <- cutree(row.hclust,3)[row.hclust$order]
cutpoints <- which(row.cut[-1]!=row.cut[-length(row.cut)])
ymin <- par("usr")[3]    #in general incorrect
ymax <- par("usr")[4]   #in general incorrect
for (i in cutpoints){
  thisy <- ymin + (ymax-ymin)*(i-1)/nrow(x)
  abline(h=thisy,lw=3)
}

(Continue reading)

Steven Wolf | 1 Jul 03:12 2011
Picon

Re: source, echo...and clicking the mouse

Ok, I think I see how flush.console() works.  Just put it in and whatever
has been done so far (and stored in the buffer) pops out.  Unfortunately,
I'm doing an optimization, and the process is slow.  So that is where the
"Misc|Buffered output" option is helpful.

Thanks!
-Steve

-----Original Message-----
From: Duncan Murdoch [mailto:murdoch.duncan <at> gmail.com] 
Sent: Thursday, June 30, 2011 6:31 PM
To: Greg Snow
Cc: Steven Wolf; 'David Winsemius'; r-help <at> r-project.org
Subject: Re: [R] source, echo...and clicking the mouse

On 30/06/2011 5:33 PM, Greg Snow wrote:
> On some operating systems (which we don't know yours, see the posting
guide) the output is buffered and including a call to flush.console() will
flush all the output from the buffer to the console.  Put the function call
throughout the script and when it is run it will stop buffering for a bit.

The OP said he's running in Windows 7.  In that case, there's the
"Misc|Buffered output" option, which makes things appear as soon as they are
printed.  It appears to work for source(..., echo=TRUE) as well.

Duncan Murdoch

>
> The other possibility is that your script does some plotting and that is
what is pausing until you click.  In that case you need to use a different
(Continue reading)

David Winsemius | 1 Jul 03:26 2011
Picon
Picon

Re: highlighting clusters in a heatmap


On Jun 30, 2011, at 8:02 PM, Levi Waldron wrote:

> I would like to draw horizontal or vertical lines on a heatmap to
> highlight the clusters at some specified cut depth of the dendrogram.
> As a hacked example, the following code would work if I could set the
> coordinates of the top and bottom of the false color image correctly
> (ymin and ymax), but the correct values seem to depend on the output
> device and its size.  I realize that heatmaps use a 2x2 layout which
> makes the coordinate system non-obvious, but the result seems very
> difficult to customize.  I would appreciate any suggestions for manual
> or pre-made solutions.

The code discloses the color image is made with the 'image' function  
and that its arguments include:

   ...,  xlim = 0.5 + c(0, nc), ylim = 0.5 + c(0, nr), ...

?image        # for details of coordinate choices.

Given the way the coordinate systems of that call  might get messed   
up by the subsequent 'plot' call, my guess is that the fastest way to  
get what you want is to hack 'heatmap' by adding a couple of argument  
and sticking a couple of "highlighting" functions just after the image  
call. (You haven't said how you are picking these levels.)

--

-- 
David.

>
(Continue reading)

Thomas.Adams | 1 Jul 03:41 2011
Picon

Re: Looking for Filliben (correlation test)


----- Original Message -----
From: gaiarrido <gaiarrido <at> usal.es>
Date: Thursday, June 30, 2011 1:11 pm
Subject: Re: [R] Looking for Filliben (correlation test)
To: r-help <at> r-project.org
Mario,

I did a google search and found this: http://genepi.qimr.edu.au/staff/davidD/R/filliben.R

Cheers!
Tom

> Thanks very much, but...the OP, what's that?
> Sorry
> 
> -----
> Mario Garrido Escudero
> PhD student
> Dpto. de Biología Animal, Ecología, Parasitología, Edafología y Qca. Agrícola
> Universidad de Salamanca
> --
> View this message in context: 
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help <at> r-project.org mailing list
> 
> PLEASE do read the posting guide 
> and provide commented, minimal, self-contained, reproducible code.
(Continue reading)

Downey, Patrick | 1 Jul 05:08 2011

merge function

Hello,

I'm clearly confused about the merge function. In the following

r <- merge(x,y,all.x=T,all.y=F)

my y vector has only unique values (no duplicates). So I don't understand
how this can ever generate an r which is of greater length than x. 

I thought the default behavior was only matching rows are included, but
that using all.x=T included rows with unmatched x's as well. If all the y's
are unique, though, I don't understand how length(r) > length(x) is
possible. 

Some clarification would be great.

Thanks,
Mitch

	[[alternative HTML version deleted]]

Downey, Patrick | 1 Jul 05:22 2011

Re: merge function

I was mistaken. There were duplicates in my y vector. Please ignore my
previous message. Sorry. 

-----Original Message-----
From: Downey, Patrick
Sent: Thu 6/30/2011 11:08 PM
To: r-help <at> r-project.org
Subject: merge function

Hello,

I'm clearly confused about the merge function. In the following

r <- merge(x,y,all.x=T,all.y=F)

my y vector has only unique values (no duplicates). So I don't understand
how this can ever generate an r which is of greater length than x. 

I thought the default behavior was only matching rows are included, but
that using all.x=T included rows with unmatched x's as well. If all the y's
are unique, though, I don't understand how length(r) > length(x) is
possible. 

Some clarification would be great.

Thanks,
Mitch

	[[alternative HTML version deleted]]

(Continue reading)

Jeff Newmiller | 1 Jul 06:48 2011
Picon
Picon

Re: merge function

You haven't provided a reproducible example.

I do notice you are using T and F which are variables that can be redefined (which is why TRUE and FALSE are preferred.
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnewmil <at> dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

"Downey, Patrick" <PDowney <at> urban.org> wrote:

Hello,

I'm clearly confused about the merge function. In the following

r <- merge(x,y,all.x=T,all.y=F)

my y vector has only unique values (no duplicates). So I don't understand
how this can ever generate an r which is of greater length than x. 

I thought the default behavior was only matching rows are included, but
that using all.x=T included rows with unmatched x's as well. If all the y's
are unique, though, I don't understand how length(r) > length(x) is
possible. 

Some clarification would be great.

(Continue reading)

UnitRoot | 1 Jul 09:01 2011
Picon

How to fit ARMA model

Hello,
I am having some problems with fitting an ARMA model to my time series data
(randomly generated numbers). The thing is I have tried many packages
[tseries, fseries, FitARMA etc.] and all of them giving very different
results. I would appreciate if someone could post here what the best package
is for my purpose. 
Also, after having done the fitting, I would like to check for the model's
adequacy. How can I do this?
Thanks.

--
View this message in context: http://r.789695.n4.nabble.com/How-to-fit-ARMA-model-tp3637632p3637632.html
Sent from the R help mailing list archive at Nabble.com.


Gmane