[Rd] debug

2009-07-27 Thread Robert Gentleman

Hi,
  I just committed a change to R-devel so that if debug is called on an 
S3 generic function, all methods will also automatically have debug 
turned on for them (if they are dispatched to from the generic).


  I hope to be able to extend this to S4 and a few other cases that are 
currently not being handled over the the next few weeks.


  Please let me know if you have problems, or suggested improvements.

 Robert
--
Robert Gentleman, PhD
Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
PO Box 19024
Seattle, Washington 98109-1024
206-667-7700
rgent...@fhcrc.org

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


Re: [Rd] bug in approx crashes R

2009-07-27 Thread Vadim Ogranovich
Thank you Bill.

The original motivation for my experiments with setting yleft to NULL was to 
see if I could get more flexibility that that allowed by the 'rule' argument. 
To recall:

rule: an integer describing how interpolation is to take place
  outside the interval ['min(x)', 'max(x)']. If 'rule' is '1'
  then 'NA's are returned for such points and if it is '2', the
  value at the closest data extreme is used.

What I wanted is to interpolate at the left end, but not at the right end. 
Still don't know how to do that.

I agree that having a clear error message when yleft, yright, and f are set to 
non-scalars is better than silently returning NA.

Thanks,
Vadim


-Original Message-
From: William Dunlap [mailto:wdun...@tibco.com]
Sent: Monday, July 27, 2009 12:14 PM
To: Vadim Ogranovich; r-devel@r-project.org
Subject: RE: [Rd] bug in approx crashes R

The C code called by approx (via .C, not .Call), following the help
file,
assumes that yleft and yright are scalars but NULL is not scalar.
The following change would let your example work (returning NA)

--- R/approx.R  (revision 48911)
+++ R/approx.R  (working copy)
@@ -61,8 +61,8 @@
 }
 y <- .C("R_approx", as.double(x), as.double(y), as.integer(nx),
xout = as.double(xout), as.integer(length(xout)),
-   as.integer(method), as.double(yleft), as.double(yright),
-   as.double(f), NAOK = TRUE, PACKAGE = "stats")$xout
+   as.integer(method), as.double(yleft)[1],
as.double(yright)[1],
+   as.double(f)[1], NAOK = TRUE, PACKAGE = "stats")$xout
 list(x = xout, y = y)
 }

but I think it would be better to get an error message that yleft,
yright, and f are expected to be scalar:

--- R/approx.R  (revision 48911)
+++ R/approx.R  (working copy)
@@ -59,6 +59,7 @@
stop("'approx' requires n >= 1")
xout <- seq.int(x[1L], x[nx], length.out = n)
 }
+stopifnot(length(yleft)==1, length(yright)==1, length(f)==1)
 y <- .C("R_approx", as.double(x), as.double(y), as.integer(nx),
xout = as.double(xout), as.integer(length(xout)),
as.integer(method), as.double(yleft), as.double(yright),


Bill Dunlap
TIBCO Software Inc - Spotfire Division
wdunlap tibco.com

> -Original Message-
> From: r-devel-boun...@r-project.org
> [mailto:r-devel-boun...@r-project.org] On Behalf Of Vadim Ogranovich
> Sent: Tuesday, July 21, 2009 12:24 PM
> To: 'r-devel@r-project.org'
> Subject: [Rd] bug in approx crashes R
>
> Dear R-devel,
>
> The following line crashes R
> > approx(1, 1, 0, method='const', rule=2, f=0, yleft=NULL,
> ties='ordered')$y
>
> Process R:2 exited abnormally with code 5 at Tue Jul 21 14:18:09 2009
>
>
> > version
>_
> platform   i386-pc-mingw32
> arch   i386
> os mingw32
> system i386, mingw32
> status
> major  2
> minor  9.1
> year   2009
> month  06
> day26
> svn rev48839
> language   R
> version.string R version 2.9.1 (2009-06-26)
>
> Thanks,
> Vadim
>
> Note: This email is for the confidential use of the named
> addressee(s) only and may contain proprietary, confidential
> or privileged information. If you are not the intended
> recipient, you are hereby notified that any review,
> dissemination or copying of this email is strictly
> prohibited, and to please notify the sender immediately and
> destroy this email and any attachments.  Email transmission
> cannot be guaranteed to be secure or error-free.  Jump
> Trading, therefore, does not make any guarantees as to the
> completeness or accuracy of this email or any attachments.
> This email is for informational purposes only and does not
> constitute a recommendation, offer, request or solicitation
> of any kind to buy, sell, subscribe, redeem or perform any
> type of transaction of a financial product.
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

Note: This email is for the confidential use of the named addressee(s) only and 
may contain proprietary, confidential or privileged information. If you are not 
the intended recipient, you are hereby notified that any review, dissemination 
or copying of this email is strictly prohibited, and to please notify the 
sender immediately and destroy this email and any attachments.  Email 
transmission cannot be guaranteed to be secure or error-free.  Jump Trading, 
therefore, does not make any guarantees as to the completeness or accuracy of 
this email or any attachments.  This email is for informational purposes only 
and does not constitute a recommendation, offer, request or solicitation of any 
kind to buy, sell, subscribe, redeem or perform any type of transaction of a 
financial product.

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


Re: [Rd] bug in approx crashes R

2009-07-27 Thread William Dunlap
The C code called by approx (via .C, not .Call), following the help
file,
assumes that yleft and yright are scalars but NULL is not scalar.
The following change would let your example work (returning NA)

--- R/approx.R  (revision 48911)
+++ R/approx.R  (working copy)
@@ -61,8 +61,8 @@
 }
 y <- .C("R_approx", as.double(x), as.double(y), as.integer(nx),
xout = as.double(xout), as.integer(length(xout)),
-   as.integer(method), as.double(yleft), as.double(yright),
-   as.double(f), NAOK = TRUE, PACKAGE = "stats")$xout
+   as.integer(method), as.double(yleft)[1],
as.double(yright)[1],
+   as.double(f)[1], NAOK = TRUE, PACKAGE = "stats")$xout
 list(x = xout, y = y)
 }

but I think it would be better to get an error message that yleft,
yright, and f are expected to be scalar:

--- R/approx.R  (revision 48911)
+++ R/approx.R  (working copy)
@@ -59,6 +59,7 @@
stop("'approx' requires n >= 1")
xout <- seq.int(x[1L], x[nx], length.out = n)
 }
+stopifnot(length(yleft)==1, length(yright)==1, length(f)==1)
 y <- .C("R_approx", as.double(x), as.double(y), as.integer(nx),
xout = as.double(xout), as.integer(length(xout)),
as.integer(method), as.double(yleft), as.double(yright),


Bill Dunlap
TIBCO Software Inc - Spotfire Division
wdunlap tibco.com  

> -Original Message-
> From: r-devel-boun...@r-project.org 
> [mailto:r-devel-boun...@r-project.org] On Behalf Of Vadim Ogranovich
> Sent: Tuesday, July 21, 2009 12:24 PM
> To: 'r-devel@r-project.org'
> Subject: [Rd] bug in approx crashes R
> 
> Dear R-devel,
> 
> The following line crashes R
> > approx(1, 1, 0, method='const', rule=2, f=0, yleft=NULL, 
> ties='ordered')$y
> 
> Process R:2 exited abnormally with code 5 at Tue Jul 21 14:18:09 2009
> 
> 
> > version
>_
> platform   i386-pc-mingw32
> arch   i386
> os mingw32
> system i386, mingw32
> status
> major  2
> minor  9.1
> year   2009
> month  06
> day26
> svn rev48839
> language   R
> version.string R version 2.9.1 (2009-06-26)
> 
> Thanks,
> Vadim
> 
> Note: This email is for the confidential use of the named 
> addressee(s) only and may contain proprietary, confidential 
> or privileged information. If you are not the intended 
> recipient, you are hereby notified that any review, 
> dissemination or copying of this email is strictly 
> prohibited, and to please notify the sender immediately and 
> destroy this email and any attachments.  Email transmission 
> cannot be guaranteed to be secure or error-free.  Jump 
> Trading, therefore, does not make any guarantees as to the 
> completeness or accuracy of this email or any attachments.  
> This email is for informational purposes only and does not 
> constitute a recommendation, offer, request or solicitation 
> of any kind to buy, sell, subscribe, redeem or perform any 
> type of transaction of a financial product.
> 
> __
> 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] noweb and R

2009-07-27 Thread Gregor Gorjanc
Terry

Take a look in R News - there was a paper published on that topic.

gg

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


Re: [Rd] How to create a permanent dataset in R.

2009-07-27 Thread Alex D'Amour
Please see http://cran.r-project.org/doc/manuals/R-exts.html.

On Mon, Jul 27, 2009 at 1:50 AM, Albert EINstEIN wrote:
>
> Hi,
>         Thanks for your valuable reply.
> can you provide me some more information regarding . Here we are reloading
> the data when we start the R, In R there are some default packages with
> datasets can we create a dataset permanently in any packages so that we can
> get the dataset without reloading,like creating dataset in a permanent
> library in SAS .
>
>   can we create our own packages in R. It would be very helpful for us, if
> you provide any information regarding this.
>
> Thanks for your reply in advance
> --
> View this message in context: 
> http://www.nabble.com/How-to-create-a-permanent-dataset-in-R.-tp24639146p24673895.html
> Sent from the R devel mailing list archive at Nabble.com.
>
> __
> 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] noweb and R

2009-07-27 Thread Terry Therneau
 I'm working on the next release of coxme (ready to start some testing), and 
have written major chunks of it using noweb -- very similar to Sweave except 
I'm 
generating code and documentation for the code rather than vingetes.
 
 The question: I have directory with .Rnw objects and a Makefile therein that 
generates most of the .R files.  I don't see any guidance in the documentation 
on where this should preferably be placed in the package tree.  
 
Thanks for any pointers (or opinions)

Terry T

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


[Rd] how to change FPU control word?

2009-07-27 Thread Martin Becker

Dear developers,

is there (already) a platform-independent way for (temporarily!) 
changing the fpu control word?
More precisely: I am looking for functions (accessible from C code in R 
packages) which read and write the fpu control word on x86 cpus (and 
cause no harm otherwise), because I need to (temporarily) turn off 
internal 80-bit precision for some algorithms relying on 64-bit IEEE 
arithmetics. Currently, I am using inline assembler (which works for x86 
cpus on Linux and Windows (MinGW)), but I am not sure what happens for 
other cpus/OSs (and I am not able to check this). I hope, there is 
already a better solution.

Any hints appreciated!

Thanks,
 Martin

--
Dr. Martin Becker
Statistics and Econometrics
Saarland University
Campus C3 1, Room 206
66123 Saarbruecken
Germany

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


[Rd] WRONG mailing list -- How to create ...

2009-07-27 Thread Martin Maechler
> "AE" == Albert EINstEIN 
> on Sun, 26 Jul 2009 22:50:14 -0700 (PDT) writes:

PLEASE!  These are typical quesions of R beginners.

They do  *NOT*  belong to the R-devel mailing list,
but rather to R-help  (and even then: 

PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
  

)

Again: do *NOT* misuse R-devel with such questions. They do not
belong here at all.

Martin  


AE> Hi, Thanks for your valuable reply.  can you provide me
AE> some more information regarding . Here we are reloading
AE> the data when we start the R, In R there are some
AE> default packages with datasets can we create a dataset
AE> permanently in any packages so that we can get the
AE> dataset without reloading,like creating dataset in a
AE> permanent library in SAS .

AE>can we create our own packages in R. It would be very
AE> helpful for us, if you provide any information regarding
AE> this.

AE> Thanks for your reply in advance -- View this message in
AE> context:
AE> 
http://www.nabble.com/How-to-create-a-permanent-dataset-in-R.-tp24639146p24673895.html
AE> Sent from the R devel mailing list archive at
AE> Nabble.com.

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

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