john.maindonald | 1 Mar 04:55 2009
Picon
Picon

[Rd] Wishlist for plot.lm() (PR#13560)

Full_Name: John Maindonald
Version: R-2.8.1
OS: MacOS X 10.5.6
Submission from: (NULL) (203.173.3.75)

The following code demonstrates an annoyance with plot.lm():

library(DAAGxtras)
x11(width=3.75, height=4)
nihills.lm <- lm(log(time) ~ log(dist) + log(climb), data = nihills)
plot(nihills.lm, which=5)

OR try the following
xy <- data.frame(x=c(3,1:5), y=c(-2, 1:5))
plot(lm(y ~ x, data=xy), which=5)

The "Cook's distance" text overplots the label for the point with the smallest
residual.  This is an issue when the size of the plot is much less than the
default, and the pointsize is not reduced proportionately.

I suggest the following:
     xx <- hii
     xx[xx >= 1] <- NA
## Insert new code
     fracht <- (1.25*par()$cin[2])/par()$pin[2]
     ylim[1] <- ylim[1] - diff(ylim)*max(0, fracht-0.04)
## End insert new code
     plot(xx, rsp, xlim = c(0, max(xx, na.rm = TRUE)),
          ylim = ylim, main = main, xlab = "Leverage",
          ylab = ylab5, type = "n", ...)
(Continue reading)

Uwe Ligges | 1 Mar 10:41 2009
Picon

Re: [Rd] Help on Making R Packages


Romina Rengel wrote:
> I'm trying to make a R package for a work in university. It´s my first time
> and i made some modifications on Pam algorithm that is included on cluster
> package.
> So before run Rcmd build command i made the next things:
> 1- I modified pam.c and cluster.h code. I added two new arguments on pam.
> 2- I modified pam.q, i added there my two new arguments.
> 4- I create all the necessary subdirectories (man, data, src, R, etc) and
> files necessaries. I put on c:\Cluster2
> 5- I run on cmd: Rcmd build --force --binary c:/cluster2
> And the package was created (file .zip)
> 6- I installed and load my package on R
> 
> After this i tried to test with Ruspini dataset
> so I write something like:
> 
> x <-ruspini
> dd <- pam(x,3)

Do you have an adapted R function in your package?
I'd suggest to rename your function slightly (as well as the C API) in 
order to avoid conflicts with the original pam(), particularly in case 
you need the cluster package to be loaded.

Uwe Ligges

> But an error happens, function pam not recognize my 2 new arguments. It's
> like function PAM on R is not linked to my pam code on C++.
> I really need if someone can help me and tell me what i´m doing wrong.
(Continue reading)

Prof Brian Ripley | 1 Mar 11:51 2009
Picon
Picon

Re: [Rd] using predict method with an offset

The para quoted dates from before the stats package was split off in 
2003, and is historical (it was true at one point, but not in R 
2.0.0, the earliest running version I have).

There is however still some truth lurking there: the code is

 	offset <- if (!is.null(off.num <- attr(tt, "offset")))
 	    eval(attr(tt, "variables")[[off.num+1]], newdata)
 	else if (!is.null(object$offset))
 	    eval(object$call$offset, newdata)

so if there is an offset term in the formula, the offset argument is 
ignored (unlike when fitting).  Further, this is wrong if there is 
more than one offset term.  Both of those would be pretty unusual, but 
I'll commit fixes for them.

predict.glm calls predict.lm to do this, so the same issues apply to 
it.

I've always thought that an 'offset' argument to lm and glm was an 
unnecessary complication (I think it predates the offset() function in 
R, although it is in the White Book p.222, for glm only).

On Fri, 27 Feb 2009, Heather Turner wrote:

> Hi Ken,
>
> First of all, whether you specify the offset by the argument or in the
> formula, your code requires that q25 is the same length as the variable
> Contr. You can set this up by defining your new data as follows:
(Continue reading)

plwm2 | 1 Mar 12:10 2009
Picon
Picon

[Rd] Colour mistake (PR#13562)

Full_Name: Peter Man
Version: 2.8.1
OS: Windows Vista
Submission from: (NULL) (128.232.240.217)

When typing out any command (for example 'log'), and using auto-completion of
that command by pressing tab twice in order to view all possible 'completions',
when you next press anything, the command turns blue rather than keeping the
original red colour.

______________________________________________
R-devel <at> r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Prof Brian Ripley | 2 Mar 09:31 2009
Picon
Picon

Re: [Rd] Colour mistake (PR#13562)

This is the way Rgui (which I guess you mean as Rterm
does not use colours) was intended to work, so it is not a 'mistake'.

Rather than 'red' and 'blue', Rgui has user-selectable separate 
colours for user input (default DarkRed) and for R output (default 
NavyBlue).  When you do what I believe you did (at least if 'anything' 
is not TAB again) you are accepting a completion, which is R output 
and hence is in the 'R output' colour.

What I understand you were expecting was that completions be treated 
as user input.  That is I think fairly simple to do, and I've made the 
change in R-devel (r48038).  Please try that (snapshots will be 
available tomorrow UK time) and let us know if you find the behaviour 
more intuitive.

On Sun, 1 Mar 2009, plwm2 <at> cam.ac.uk wrote:

> Full_Name: Peter Man
> Version: 2.8.1
> OS: Windows Vista
> Submission from: (NULL) (128.232.240.217)
>
>
> When typing out any command (for example 'log'), and using auto-completion of
> that command by pressing tab twice in order to view all possible 'completions',
> when you next press anything, the command turns blue rather than keeping the
> original red colour.
>
> ______________________________________________
> R-devel <at> r-project.org mailing list
(Continue reading)

Martin Maechler | 2 Mar 11:16 2009
Picon

Re: [Rd] Unexpected side effect of the ":::" operator on the value of isGeneric

>>>>> "Wolfi" == Wolfgang Huber <huber <at> ebi.ac.uk>
>>>>>     on Sat, 28 Feb 2009 18:01:19 +0000 writes:

    Wolfi> Dear Martin name masking is a separate issue, which I
    Wolfi> do not want to explore here.

    Wolfi> If one accepts the notion that unrelated generics of
    Wolfi> the same name may exist in different namespaces (user
    Wolfi> confusion aside, I don't see a technical reason why
    Wolfi> one shouldn't), then I find the behaviour of R in the
    Wolfi> below case puzzling: the value of
    Wolfi> "showMethods(something)" called from the global
    Wolfi> environment depends on whether or not the expression
    Wolfi> "package::something" has previously been
    Wolfi> evaluated. The value of isGeneric(something) is
    Wolfi> different when called from top-level and when called
    Wolfi> within showMethods.

    Wolfi> Best wishes Wolfgang

    Wolfi> PS1: I do apologize if this behaviour is intentional,
    Wolfi> and documented somewhere. I would then be puzzled
    Wolfi> even more though.

    Wolfi> PS2: My code example used ":::", and there are some
    Wolfi> vague warnings in its man page that ":::" is
    Wolfi> "dangerous". The problem also occurs with "::".

Thank you, Wolfgang (and Martin Morgan), for the clarification,
here and off-line. 
(Continue reading)

Corrado | 2 Mar 11:41 2009
Picon

Distance between clusters

Dear friends

I reformulate the question. I think I did not formulate it properly.

I have some data on some sites. I can define a dissimilarity between each pair 
of sites. Using this dissimilarity, I have clustered the sites using the 
hclust algorithm, with method ward. I then obtain 48 clusters, by cutting the 
tree using cutree with k=48. 

I would now like to estimate the distance between each pair of the 48 
resulting clusters. I have read the documentation, but I cannot find a 
solution.

Any clue on how I can do that?

This is a snippet of the code:

distPredTurn<-as.dist(dissimilarityMatrix)
hctr<-hclust(distPredTurn,"ward")
cutree(hctr,k=48)

Regards
--

-- 
Corrado Topi

Global Climate Change & Biodiversity Indicators
Area 18,Department of Biology
University of York, York, YO10 5YW, UK
Phone: + 44 (0) 1904 328645, E-mail: ct529 <at> york.ac.uk

(Continue reading)

marycmeyer | 2 Mar 17:15 2009
Picon

[Rd] R does not start on my MacBook Pro3,1 (PR#13565)

Help!   I was running R code and started getting error messages that  
would not stop repeating.  I force-quit R, but when I attempted to run  
it again, it would not start (Icon kept bouncing until I force-quit  
again).  I restarted the computer, then I reinstalled R, but that did  
not fix the problem.  I deleted everything I could find related to R,  
and installed again. Each time I install I get a "successful" message,  
but it does not start.  I don't know what to try next.

I have the latest versions of the operating system.

Thanks very much for your time.

Sincerely,
Mary Meyer
Statistics Department
Colorado State University

meyer <at> stat.colostate.edu

	[[alternative HTML version deleted]]

______________________________________________
R-devel <at> r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Mathieu Ribatet | 2 Mar 20:19 2009
Picon
Picon

Re: [Rd] R does not start on my MacBook Pro3,1 (PR#13565)

I'm not sure this will work under MacOS but you should try to run R from
a shell and see any informative message displayed in it.

Cheers,
Mathieu

* it might be useful to give us some details about the code you ran and
caused the issue.

Le lundi 02 mars 2009 à 17:15 +0100, marycmeyer <at> mac.com a écrit :
> Help!   I was running R code and started getting error messages that  
> would not stop repeating.  I force-quit R, but when I attempted to run  
> it again, it would not start (Icon kept bouncing until I force-quit  
> again).  I restarted the computer, then I reinstalled R, but that did  
> not fix the problem.  I deleted everything I could find related to R,  
> and installed again. Each time I install I get a "successful" message,  
> but it does not start.  I don't know what to try next.
> 
> I have the latest versions of the operating system.
> 
> Thanks very much for your time.
> 
> Sincerely,
> Mary Meyer
> Statistics Department
> Colorado State University
> 
> meyer <at> stat.colostate.edu
> 
> 	[[alternative HTML version deleted]]
(Continue reading)

Paul Gilbert | 2 Mar 23:00 2009
Picon

[Rd] S4 data dump or?

I am trying to dump some data in a file that I will add to a package.  
The data has an attribute which is a S4 object, and this seems to cause 
problems.   What is the preferred way to write a file with a dataset 
that has some S4 parts, so that it can be included in a package?

Paul Gilbert
====================================================================================

La version française suit le texte anglais.

------------------------------------------------------------------------------------

This email may contain privileged and/or confidential in...{{dropped:26}}

______________________________________________
R-devel <at> r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Gmane