[Rd] script window fails to load script (PR#8564)

2006-02-04 Thread helen . mills
Full_Name: helen mills poulos
Version: 2.2.1
OS: windows
Submission from: (NULL) (68.9.235.48)


When using the randomForest package, I have had problems when running scripts
after r has been open for some time, and after running multiple iterations of
random forest. After about the 4th or 5th time I run a randomForest script from
the script window in r, r just runs an old script that I ran before, rather than
the one I just edited. This happens regardles of whether I send the script using
ctrl r from the script window or I type in the script manually. I end up having
to shut down r and start over again.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] javascript device for R

2006-02-04 Thread Romain Francois
Hi,

Has anyone started a javascript device for R.
I don't see something like that googling or at on 
http://www.stat.auckland.ac.nz/~paul/R/devices.html
For example, using that graphics library : 
http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm
(I cc that message to the author.)

ps : this is not a feature request, i will do it. But if someone has 
started that, let me know.

Romain

-- 
visit the R Graph Gallery : http://addictedtor.free.fr/graphiques
mixmod 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php
+---+
| Romain FRANCOIS - http://francoisromain.free.fr   |
| Doctorant INRIA Futurs / EDF  |
+---+

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Citation of R packages

2006-02-04 Thread Friedrich . Leisch
> On Mon, 30 Jan 2006 10:06:52 +1100 (EST),
> John Maindonald (JM) wrote:

  > The bibtex citations provided by citation() do not
  > work all that well in cases where there is no printed
  > document to reference:

That's why there is a warning at the end that they will need manual
editing ... IMHO they at least save you some typing effort in many
cases.

  > (1) A version field is needed, as the note field is
  > required for other purposes, currently trying to
  > sort out nuances that cannot be sorted out in the
  > author list (author, compiler, implementor of R version,
  > contributor, ...) and maybe giving a cross-reference
  > to a book or paper that is somehow relevant.

Why should a reference cross-reference another reference? Could you
give an example?

  > (2) Maybe the author field should be more nuanced, or
  > maybe ...

author fields of bibtex entries have a strict format (names separated
by "and"), what do you mean by "more nuanced"?

  > (3) In compiling a list of packages, name order seems
  > preferable, and one wants the title first (achieved by
  > relocating the format.title field in the manual FUNCTION
  > in the .bst file
  > (4) manual seems not an ideal name for the class, if
  > there is no manual.

A package always has a "reference manual", the concatenated help pages
certainly qualify as such and can be downloaded in PDF format from
CRAN. The ISBN rules even allow to assign an ISBN number to the online
help of a software package which also can serve as the ISBN number of
the *software itself* (which we did for base R).

  > Maybe what is needed is a package or suchlike class,
  > and several alternative .bst files that handle the needed
  > listings.

  > I know at least one other person who is wrestling with
  > this, and others on this list must be wrestling with it.

I am certainly open for discussions and any suggestions for
improvements, but it must be within the standard bibtex entry types,
we cannot write our own entry types and .bst files. Many journals
require the usage of their own (or standard) bibtex styles, and the
entries we produce must work with those. If R creates nonstandard
bibtex entries even more manual work will be necessary in many
cases.

I have no definitive bibtex reference at hand, but the natbib style
files (a very popular collection of bibtex styles, at least I
definitely want to be compatible with those) define

 article
 book
 booklet
 conference  (= alias for inproceedings)
 inbook
 incollection
 inproceedings
 manual
 mastersthesis
 misc
 phdthesis
 proceedings
 techreport
 unpublished

which coincide with the choices the emacs bibtex mode offers. Out of
these only "manual", "misc" and "unpublished" seem appropriate for
packages, and the description suggests to use manual for citing
software manuals, but the definitions of those three are very similar
anyway.

Maybe you could give an example what your candidate for a bibtex entry
for packages should look like?

Best,
Fritz

-- 
---
Friedrich Leisch 
Institut für Statistik Tel: (+43 1) 58801 10715
Technische Universität WienFax: (+43 1) 58801 10798
Wiedner Hauptstraße 8-10/1071
A-1040 Wien, Austria http://www.ci.tuwien.ac.at/~leisch

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] What about a bib file

2006-02-04 Thread Friedrich . Leisch
> On Mon, 30 Jan 2006 17:49:37 -0500 (EST),
> Vincent Carey 525-2265 (VC5) wrote:

  > Romain Francois suggests that a central bibliographic database
  > (possibly in bibtex format) might be useful for reference inclusion
  > in R package man pages.  This has been discussed by a small
  > group, with one proposal presented for a package-specific bibtex database
  > placed in a dedicated package subdirectory.  Man page references would
  > then cite the sources enumerated in the database using their bibtex
  > tags.  This approach could encourage better annotation and should
  > confer greater accuracy on package:literature referencing.

  > This does not rule out a central archive that might include all the
  > references cited in base man pages.

  > We are doing some work on harvesting the bibliographic citations
  > in man pages in an R distribution, and converting them to a regular
  > format.  The \references section is free form, so the conversion
  > is not trivial, but progress has been made.

  > The infrastructure required to use this approach to propagate
  > (e.g., bibtex-formatted) bibliographic data into the man pages that
  > cite the sources is not yet available, but we hope to have some
  > prototypes in the next month.

Sounds great! The "hardest" parts are probably

1) a bibtex parser in R
2) at least one function converting arbitrary bibtex entries to text,
   i.e., the R equivalent of a .bst file.

(I'm only guessing what such a system would involve).

After looking into it when writing the citation() infrastructure I
decided I don't want to do it and went straight to S objects written
by the package author. All those string replacements and possible LaTeX
markup simply looked like too much effort for just 1-2 entries per
package ;-)

But it would be great to have the above functionality in R, of
course, and "all references" in a package are certainly a larger set
then what citation() should report, making the effort worthwhile.

My only wish is that the bibtex parser returns objects compatible to
class "citation" (either the same class or simple coercion). I
modelled the class after bibtex entries anyway, so that shouldn't be a
restriction (I hope). If we need to modify class "citation" to be
accomodate your needs, please let me know.

Once we can suck bibtex files into R it would be trivial to give users
a choice between writing

 CITATION files in the current form (with the benefit of headers and
 footers)

or

 mark certain entries in the PACKAGE.bib file (whatever its name may be) 
 that they should be reported by citation().

Best,
Fritz

PS: Of course I volunteer to alpha-test any prototypes you have,

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Rprintf loop status does not print under windows

2006-02-04 Thread Andrew Finley
Hello,
I am writing a c/c++ extension package that does some mcmc sampling, and
periodically writes the sampling status to the terminal via Rprintf.  So in
my sampling loop I have:

if(status == 100){
  Rprintf("%i...", s);
  status = 0;
}
status++;

Under linux/unix this works fine, but under windows the status is not
printed.  Am I missing something?

Thanks-
Andy

-- 
Andrew Finley, Research Fellow
Department of Forest Resources
College of Natural Resources
University of Minnesota
305 Green Hall
1530 Cleveland Avenue N.
St. Paul, MN 55108

Ph 612-624-1714 office
http://blue.fr.umn.edu/home

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Rprintf loop status does not print under windows

2006-02-04 Thread Duncan Murdoch
On 2/4/2006 1:14 PM, Andrew Finley wrote:
> Hello,
> I am writing a c/c++ extension package that does some mcmc sampling, and
> periodically writes the sampling status to the terminal via Rprintf.  So in
> my sampling loop I have:
> 
> if(status == 100){
>   Rprintf("%i...", s);
>   status = 0;
> }
> status++;
> 
> Under linux/unix this works fine, but under windows the status is not
> printed.  Am I missing something?

Looks like you have buffering enabled (the default).  In the Misc menu 
item, uncheck "buffered output" and you should see things sooner (but 
slower).

Duncan Murdoch

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Rprintf loop status does not print under windows

2006-02-04 Thread Liaw, Andy


> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Duncan Murdoch
> Sent: Saturday, February 04, 2006 1:23 PM
> To: Andrew Finley
> Cc: r-devel@r-project.org
> Subject: Re: [Rd] Rprintf loop status does not print under windows
> 
> 
> On 2/4/2006 1:14 PM, Andrew Finley wrote:
> > Hello,
> > I am writing a c/c++ extension package that does some mcmc 
> sampling, and
> > periodically writes the sampling status to the terminal via 
> Rprintf.  So in
> > my sampling loop I have:
> > 
> > if(status == 100){
> >   Rprintf("%i...", s);
> >   status = 0;
> > }
> > status++;
> > 
> > Under linux/unix this works fine, but under windows the 
> status is not
> > printed.  Am I missing something?
> 
> Looks like you have buffering enabled (the default).  In the 
> Misc menu 
> item, uncheck "buffered output" and you should see things sooner (but 
> slower).

... or add something like this in your C code:

#ifdef win32
R_FlushConsole();
#endif

Andy
 
> Duncan Murdoch
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
>

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] pbinom with size argument 0 (PR#8560)

2006-02-04 Thread ehlers


(Ted Harding) wrote:
> On 03-Feb-06 Peter Dalgaard wrote:
> 
>>(Ted Harding) <[EMAIL PROTECTED]> writes:
>>
>>
>>>On 03-Feb-06 [EMAIL PROTECTED] wrote:
>>>
Full_Name: Uffe Høgsbro Thygesen
Version: 2.2.0
OS: linux
Submission from: (NULL) (130.226.135.250)


Hello all.

  pbinom(q=0,size=0,prob=0.5)

returns the value NaN. I had expected the result 1. In fact any
value for q seems to give an NaN.
>>>
>>>Well, "NaN" can make sense since "q=0" refers to a single sampled
>>>value, and there is no value which you can sample from "size=0";
>>>i.e. sampling from "size=0" is a non-event. I think the probability
>>>of a non-event should be NaN, not 1! (But maybe others might argue
>>>that if you try to sample from an empty urn you necessarily get
>>>zero "successes", so p should be 1; but I would counter that you
>>>also necessarily get zero "failures" so q should be 1. I suppose
>>>it may be a matter of whether you regard the "r" of the binomial
>>>distribution as referring to the "identities" of the outcomes
>>>rather than to how many you get of a particular type. Hmmm.)
>>>
>>>
Note that

  dbinom(x=0,size=0,prob=0.5)

returns the value 1.
>>>
>>>That is probably because the .Internal code for pbinom may do
>>>a preliminary test for "x >= size". This also makes sense, for
>>>the cumulative p for any  with a finite range,
>>>since the answer must then be 1 and a lot of computation would
>>>be saved (likewise returning 0 when x < 0). However, it would
>>>make even more sense to have a preceding test for "size<=0"
>>>and return NaN in that case since, for the same reasons as
>>>above, the result is the probability of a non-event.
>>
>>Once you get your coffee, you'll likely realize that you got
>>your p's and d's mixed up...
> 
> 
> You're right about the mix-up! (I must mend the pipeline.)
> 
> 
>>I think Uffe is perfectly right: The result of zero experiments will
>>be zero successes (and zero failures) with probability 1, so the
>>cumulative distribution function is a step function with one step at
>>zero ( == as.numeric(x>=0) ).
> 
> 
> I'm perfectly happy with this argument so long as it leads to
> dbinom(x=0,size=0,prob=p)=1 and also pbinom(q=0,size=0,prob=p)=1
> (which seems to be what you are arguing too). And I think there
> are no traps if p=0 or p=1.
> 
> 
>>>(But it depends on your point of view, as above ... However,
>>>surely the two  should be consistent with each other.)
> 
> 
> Ted.

I prefer a (consistent) NaN. What happens to our notion of a
Binomial RV as a sequence of Bernoulli RVs if we permit n=0?
I have never seen (nor contemplated, I confess) the definition
of a Bernoulli RV as anything other than some dichotomous-outcome
one-trial random experiment. Not n trials, where n might equal zero,
but _one_ trial. I can't see what would be gained by permitting a
zero-trial experiment. If we assign probability 1 to each outcome,
we have a problem with the sum of the probabilities.

Peter Ehlers
> 
> 
> E-Mail: (Ted Harding) <[EMAIL PROTECTED]>
> Fax-to-email: +44 (0)870 094 0861
> Date: 03-Feb-06   Time: 15:07:49
> -- XFMail --
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] pbinom with size argument 0 (PR#8560)

2006-02-04 Thread P Ehlers


(Ted Harding) wrote:
> On 03-Feb-06 Peter Dalgaard wrote:
> 
>>(Ted Harding) <[EMAIL PROTECTED]> writes:
>>
>>
>>>On 03-Feb-06 [EMAIL PROTECTED] wrote:
>>>
Full_Name: Uffe Høgsbro Thygesen
Version: 2.2.0
OS: linux
Submission from: (NULL) (130.226.135.250)


Hello all.

  pbinom(q=0,size=0,prob=0.5)

returns the value NaN. I had expected the result 1. In fact any
value for q seems to give an NaN.
>>>
>>>Well, "NaN" can make sense since "q=0" refers to a single sampled
>>>value, and there is no value which you can sample from "size=0";
>>>i.e. sampling from "size=0" is a non-event. I think the probability
>>>of a non-event should be NaN, not 1! (But maybe others might argue
>>>that if you try to sample from an empty urn you necessarily get
>>>zero "successes", so p should be 1; but I would counter that you
>>>also necessarily get zero "failures" so q should be 1. I suppose
>>>it may be a matter of whether you regard the "r" of the binomial
>>>distribution as referring to the "identities" of the outcomes
>>>rather than to how many you get of a particular type. Hmmm.)
>>>
>>>
Note that

  dbinom(x=0,size=0,prob=0.5)

returns the value 1.
>>>
>>>That is probably because the .Internal code for pbinom may do
>>>a preliminary test for "x >= size". This also makes sense, for
>>>the cumulative p for any  with a finite range,
>>>since the answer must then be 1 and a lot of computation would
>>>be saved (likewise returning 0 when x < 0). However, it would
>>>make even more sense to have a preceding test for "size<=0"
>>>and return NaN in that case since, for the same reasons as
>>>above, the result is the probability of a non-event.
>>
>>Once you get your coffee, you'll likely realize that you got
>>your p's and d's mixed up...
> 
> 
> You're right about the mix-up! (I must mend the pipeline.)
> 
> 
>>I think Uffe is perfectly right: The result of zero experiments will
>>be zero successes (and zero failures) with probability 1, so the
>>cumulative distribution function is a step function with one step at
>>zero ( == as.numeric(x>=0) ).
> 
> 
> I'm perfectly happy with this argument so long as it leads to
> dbinom(x=0,size=0,prob=p)=1 and also pbinom(q=0,size=0,prob=p)=1
> (which seems to be what you are arguing too). And I think there
> are no traps if p=0 or p=1.
> 
> 
>>>(But it depends on your point of view, as above ... However,
>>>surely the two  should be consistent with each other.)
> 
> 
> Ted.

I prefer a (consistent) NaN. What happens to our notion of a
Binomial RV as a sequence of Bernoulli RVs if we permit n=0?
I have never seen (nor contemplated, I confess) the definition
of a Bernoulli RV as anything other than some dichotomous-outcome
one-trial random experiment. Not n trials, where n might equal zero,
but _one_ trial. I can't see what would be gained by permitting a
zero-trial experiment. If we assign probability 1 to each outcome,
we have a problem with the sum of the probabilities.

Peter Ehlers
> 
> 
> E-Mail: (Ted Harding) <[EMAIL PROTECTED]>
> Fax-to-email: +44 (0)870 094 0861
> Date: 03-Feb-06   Time: 15:07:49
> -- XFMail --
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Using the lazy data mechanism

2006-02-04 Thread John Fox
Dear list members,

I'm trying to use the lazy data mechanism with the car package, so far
without success. The data sets are in the source package's data subdirectory
in the form of compressed .rda files, and I added the directive LazyData:
yes to the package's DESCRIPTION file.

I suspect that the problem is that the package has no namespace, but I've
been unable to find a reference in the Writing R Extensions manual (nor
elsewhere) that suggests that this is necessary. Is there a place that I've
missed that describes the lazy data mechanism?

My system info:

- snip -

Version:
 platform = i386-pc-mingw32
 arch = i386
 os = mingw32
 system = i386, mingw32
 status = 
 major = 2
 minor = 2.1
 year = 2005
 month = 12
 day = 20
 svn rev = 36812
 language = R

Windows XP Professional (build 2600) Service Pack 2.0

Locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

Search Path:
 .GlobalEnv, package:MASS, package:car, package:methods, package:stats,
package:graphics, package:grDevices, package:utils, package:datasets,
package:svIO, package:R2HTML, package:svMisc, package:svSocket,
package:svIDE, package:tcltk, Autoloads, package:base

- snip -

Thanks,
 John


John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] pbinom with size argument 0 (PR#8560)

2006-02-04 Thread p . dalgaard
P Ehlers <[EMAIL PROTECTED]> writes:

> I prefer a (consistent) NaN. What happens to our notion of a
> Binomial RV as a sequence of Bernoulli RVs if we permit n=0?
> I have never seen (nor contemplated, I confess) the definition
> of a Bernoulli RV as anything other than some dichotomous-outcome
> one-trial random experiment. 

What's the problem ??

An n=0 binomial is the sum of an empty set of Bernoulli RV's, and the
sum over an empty set is identically 0.

> Not n trials, where n might equal zero,
> but _one_ trial. I can't see what would be gained by permitting a
> zero-trial experiment. If we assign probability 1 to each outcome,
> we have a problem with the sum of the probabilities.

Consistency is what you gain. E.g. 

 binom(.,n=n1+n2,p) == binom(.,n=n1,p) * binom(.,n=n2,p)

where * denotes convolution. This will also hold for n1=0 or n2=0 if
the binomial in that case is defined as a one-point distribution at
zero. Same thing as any(logical(0)) etc., really.

-- 
   O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] a generic 'attach'?

2006-02-04 Thread Bill.Venables
Is there any reason why 'attach' is not generic in R?

I notice that it is in another system, for example, and I can see some
applications if it were so in R.

Bill Venables.


Bill Venables, 
CMIS, CSIRO Laboratories, 
PO Box 120, Cleveland, Qld. 4163 
AUSTRALIA

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel