Re: [Rd] Which programming paradigm is the most used for make R packages?

2007-01-04 Thread Gabor Grothendieck
Its object oriented in the sense of the Dylan language. It has some functional elements but true functional languages have better support for recursion, tail recursion and absence of side effects whereas side effects are common in R. On 1/4/07, Ricardo Rios [EMAIL PROTECTED] wrote: A

Re: [Rd] Wish list

2007-01-01 Thread Gabor Grothendieck
On 1/1/07, Robiert Gentleman [EMAIL PROTECTED] wrote: Gabor Grothendieck wrote: On 1/1/07, Duncan Murdoch [EMAIL PROTECTED] wrote: A few comments thrown in, and some general comments at the bottom. On 1/1/2007 1:28 AM, Gabor Grothendieck wrote: This is my 2007 New Year wishlist for R

Re: [Rd] Wish list

2007-01-01 Thread Gabor Grothendieck
Anyone who uses batch files will use it quite a bit. It certainly causes me problems on an ongoing basis and is an unacceptable conflict in my opinion. If you're using batch files, the fix I suggested is trivial for you. The batch files could come from other programs you are using which

[Rd] Fwd: [R] axis and times() problem

2006-12-28 Thread Gabor Grothendieck
The axes do not intersect with this command. Is it a bug? plot(c(.51, .6), bty = n, xaxs = i, yaxs = i) If I remove the bty = n then they do intersect. Also see: https://www.stat.math.ethz.ch/pipermail/r-help/2006-December/122734.html __

Re: [Rd] substitute creates an object which prints incorrectly (PR#9427)

2006-12-22 Thread Gabor Grothendieck
Try issuing the command: options(keep.source = FALSE) prior to running the code you displayed to force the actual source, rather than the source attribute, to be displayed by print when printing functions. On 12/21/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: The function substitute seems

Re: [Rd] apropos changes in r-devel: intended feature or bug?

2006-12-22 Thread Gabor Grothendieck
I have not been followin this thread but if apropos is changed note that the Help | Apropos menu item in Windows may to be changed depending on what the change is. On 12/22/06, Martin Maechler [EMAIL PROTECTED] wrote: Ok, so be it: We have seen that both apropos() and find() have used

Re: [Rd] turning expression object to function

2006-12-18 Thread Gabor Grothendieck
Here is one possibility. It does not use the second argument in your function call but instead assumes the arguments of the output function are those variables in the expression that have not been assigned in the list L in the order encountered. library(gsubfn) asFun - function(e, L = NULL, env

Re: [Rd] caching frequently used values

2006-12-16 Thread Gabor Grothendieck
See: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/83547.html On 12/13/06, Tamas K Papp [EMAIL PROTECTED] wrote: Hi, I am trying to find an elegant way to compute and store some frequently used matrices on demand. The Matrix package already uses something like this for storing

Re: [Rd] as.Date: conversion pb from POSIXct (PR#9386)

2006-11-27 Thread Gabor Grothendieck
as.Date is converting your object with respect to GMT time zone and in that time zone your POSIXct date is the day before. See ?as.Date and also suggest you read R News 4/1 help desk article. On 11/27/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Full_Name: Xiao Gang FAN Version: 2.4.0 OS:

Re: [Rd] package tseries: plot.irts() - time axis label pb (PR#9387)

2006-11-27 Thread Gabor Grothendieck
When I try it with R R version 2.4.0 Patched (2006-10-24 r39722) on Windows XP and the same version of tseries as yours I get tick marks labelled 1992, 1994, 1996, 1998. Try it again with a later version of R. On 11/27/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Full_Name: Xiao Gang FAN

Re: [Rd] package vignettes, suggests and R CMD check

2006-11-22 Thread Gabor Grothendieck
Assuming you don't want to split it tup: In A1 place a file A1-packages.Rd which documents all sources of documentation for A1. That can refers the user to the vignette in A2. packages?A1 will bring it up this information help file. You could also considering having a one line vignette in A1

Re: [Rd] good practice for values not provided

2006-11-19 Thread Gabor Grothendieck
One possibility is: f - function(a, b, x) if (missing(x)) a+b else a-b-x although that does have the disadvantage that one cannot explicitly tell it not to use x but rather its denoted by its absence. On 11/19/06, Tamas K Papp [EMAIL PROTECTED] wrote: Hi, I am writing a collection of

Re: [Rd] tail recursion in R

2006-11-14 Thread Gabor Grothendieck
See: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/73651.html On 11/14/06, Ross Boylan [EMAIL PROTECTED] wrote: Apparently Scheme is clever and can turn certain apparently recursive function calls into into non-recursive evaluations. Does R do anything like that? I could find no reference

Re: [Rd] invert argument in grep

2006-11-12 Thread Gabor Grothendieck
invert= would be consistent with the fact that egrep (-v), sed/vi (v) and awk (~!) all have special facilities as indicated to handle such negation/inversion. On 11/12/06, Romain Francois [EMAIL PROTECTED] wrote: Duncan Murdoch wrote: On 11/10/2006 12:52 PM, Romain Francois wrote: Duncan

Re: [Rd] data frame subscription operator

2006-11-08 Thread Gabor Grothendieck
.subset and .subset2 are equivalent to [ and [[ except that dispatch does not take place. See ?.subset On 11/8/06, Vladimir Dergachev [EMAIL PROTECTED] wrote: On Wednesday 08 November 2006 3:21 am, Prof Brian Ripley wrote: So far I was not able to figure out why this is necessary -

Re: [Rd] [R] difference in using with() and the data argument in glm (PR#9338)

2006-11-03 Thread Gabor Grothendieck
One thing I noticed is that ?glm does not really specify what happens if you do not give a value for data. Is data then just skipped so that search takes place in enivonrment(formula) only or is it supposed to default to something? Some clarification in ?glm would be helpful. On 11/3/06,

Re: [Rd] CRAN task views work only once per session (PR#9330)

2006-11-02 Thread Gabor Grothendieck
They run without problem and are identical on my XP machine too: library(ctv) x - available.views(repos = http://CRAN.uk.R-project.org;) y - available.views(repos = http://CRAN.uk.R-project.org;) identical(x,y) [1] TRUE R.version.string # XP [1] R version 2.4.0 Patched (2006-10-24 r39722)

[Rd] fields appearing in cran descriptions pages

2006-10-31 Thread Gabor Grothendieck
What determines which fields appear in CRAN descriptions pages. For example, for doBy there is no Date: but there is a vignette listed: http://cran.r-project.org/src/contrib/Descriptions/doBy.html whereas for gsubfn there is a Date: but there is no vignette listed (even though it has one).

Re: [Rd] how to determine if a function's result is invisible

2006-10-29 Thread Gabor Grothendieck
On 10/28/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 10/28/2006 6:03 PM, Philippe Grosjean wrote: Duncan Murdoch wrote: [...] I've just added this function to R-devel (to become 2.5.0 next spring): withVisible - function(x) { x - substitute(x) v -

Re: [Rd] how to determine if a function's result is invisible

2006-10-29 Thread Gabor Grothendieck
On 10/29/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 10/29/2006 8:03 AM, Gabor Grothendieck wrote: On 10/28/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 10/28/2006 6:03 PM, Philippe Grosjean wrote: Duncan Murdoch wrote: [...] I've just added this function to R-devel (to become

Re: [Rd] how to determine if a function's result is invisible

2006-10-28 Thread Gabor Grothendieck
Thanks! On 10/28/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 10/26/2006 5:26 AM, Gabor Grothendieck wrote: On 10/26/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 10/25/2006 11:02 PM, Gabor Grothendieck wrote: On 10/25/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 10/25/2006 8:14 PM

Re: [Rd] all.names() and all.vars(): sorting order of functions' return vector

2006-10-27 Thread Gabor Grothendieck
Rewrite expr2 - expression(x3 - 0.5 * x1 - 0.7 * x2) like this: expression(`-`(x3, `-`(`*`(0.5, x1), `*`(0.7, x2 and it becomes clear. On 10/27/06, Pfaff, Bernhard Dr. [EMAIL PROTECTED] wrote: Dear list-subscriber, in the process of writing a general code snippet to extract

Re: [Rd] as.missing

2006-10-27 Thread Gabor Grothendieck
On 10/26/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: This is what I get: as.missing - force f - function(y, x=1) {cat(missing(x)) ; x} g - function(x=as.missing()) f(3,x) g() FALSEError in as.missing() : argument x is missing, with no default traceback() 3: as.missing() 2: f(3

[Rd] Idea: Testimonials

2006-10-27 Thread Gabor Grothendieck
It occurred to me that we could have an optional file called TESTIMONIALS that comes with each package which could be a list of short testimonials from users indicating success with that package and possibly a few details of the successful application, e.g. it was used to analyse xyz data. Users

Re: [Rd] how to determine if a function's result is invisible

2006-10-26 Thread Gabor Grothendieck
On 10/26/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 10/25/2006 11:02 PM, Gabor Grothendieck wrote: On 10/25/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 10/25/2006 8:14 PM, Gabor Grothendieck wrote: Suppose we have a function such as the following F - function(f, x) f(x)+1

Re: [Rd] how to determine if a function's result is invisible

2006-10-26 Thread Gabor Grothendieck
On 10/26/06, Philippe Grosjean [EMAIL PROTECTED] wrote: On 10/26/06, Duncan Murdoch [EMAIL PROTECTED] wrote: [...] Actually, there is a way, but it's undocumented (i.e., use at your own risk). It's the eval.with.vis function. This is an internal function Yes... and there are three

Re: [Rd] how to determine if a function's result is invisible

2006-10-26 Thread Gabor Grothendieck
Perhaps there could be a set of functions that are made available without the promise of future compatibility but with the promise that they will change less frequently than if they were not documented and if they are changed the changes will be highlighted to make it easier for the users of the

[Rd] sourcing dput output

2006-10-25 Thread Gabor Grothendieck
Is this not supposed to work? dput(BOD, file = /BOD.R) source(/BOD.R) Error in attributes(.Data) - c(attributes(.Data), attrib) : row names must be 'character' or 'integer', not 'double' dput(iris, file = /iris.R) source(/iris.R) Error in attributes(.Data) - c(attributes(.Data),

Re: [Rd] sourcing dput output

2006-10-25 Thread Gabor Grothendieck
and not affect various commands. 2. what is the difference between dput and dump supposed to be anyways? On 25 Oct 2006 17:13:23 +0200, Peter Dalgaard [EMAIL PROTECTED] wrote: Gabor Grothendieck [EMAIL PROTECTED] writes: Is this not supposed to work? dput(BOD, file = /BOD.R) source

Re: [Rd] as.missing

2006-10-25 Thread Gabor Grothendieck
You can do it like this: as.missing - force g - function(x = as.missing()) missing(x) g(3) [1] FALSE g() [1] TRUE On 10/24/06, Paul Gilbert [EMAIL PROTECTED] wrote: (I'm not sure if this is a request for a feature, or another instance where a feature has eluded me for many years.) Often

[Rd] how to determine if a function's result is invisible

2006-10-25 Thread Gabor Grothendieck
Suppose we have a function such as the following F - function(f, x) f(x)+1 which runs function f and then transforms it. I would like the corresponding function which works the same except that unlike F returns an invisible result if and only if f does. Is there some way of determining whether

Re: [Rd] how to determine if a function's result is invisible

2006-10-25 Thread Gabor Grothendieck
On 10/25/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 10/25/2006 8:14 PM, Gabor Grothendieck wrote: Suppose we have a function such as the following F - function(f, x) f(x)+1 which runs function f and then transforms it. I would like the corresponding function which works the same

Re: [Rd] how to determine if a function's result is invisible

2006-10-25 Thread Gabor Grothendieck
On 10/25/06, Marc Schwartz [EMAIL PROTECTED] wrote: On Wed, 2006-10-25 at 20:14 -0400, Gabor Grothendieck wrote: Suppose we have a function such as the following F - function(f, x) f(x)+1 which runs function f and then transforms it. I would like the corresponding function which

Re: [Rd] how to determine if a function's result is invisible

2006-10-25 Thread Gabor Grothendieck
On 10/25/06, Marc Schwartz [EMAIL PROTECTED] wrote: On Wed, 2006-10-25 at 19:16 -0700, Deepayan Sarkar wrote: On 10/25/06, Marc Schwartz [EMAIL PROTECTED] wrote: On Wed, 2006-10-25 at 20:14 -0400, Gabor Grothendieck wrote: Suppose we have a function such as the following F

Re: [Rd] Changing function arguments

2006-10-22 Thread Gabor Grothendieck
Try this. If the first arg of FUN is x then it increments it. incrx - function (e) { is.node - function(x) is.symbol(x) || is.double(x) if (is.node(e)) return(e) if (is.name(e[[1]]) e[[1]] == as.name(FUN) names(e)[2] == x) e[[2]] - e[[2]] + 1 for (i in 1:length(e))

Re: [Rd] parse/INSTALL feature request(s)

2006-10-20 Thread Gabor Grothendieck
On 10/20/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 10/20/2006 8:32 PM, Michael Toews wrote: Hi, I have a feature request for 'parse', and possibly the 'R CMD INSTALL' command to display more informative error information. Specifically, after making several modifications to a package

Re: [Rd] arraytake for extracting subarrays from multidimensional arrays

2006-10-19 Thread Gabor Grothendieck
Note that it can also be done like with do.call: a - array(1:24, 2:4) L - list(TRUE, 1:3, c(4, 2)) do.call([, c(list(a), L)) On 10/19/06, Balaji S. Srinivasan [EMAIL PROTECTED] wrote: Hi, I recently encountered a problem with array subsetting and came up with a fix. Given an array of

Re: [Rd] Error: subscript out of bounds (PR#9305)

2006-10-18 Thread Gabor Grothendieck
See ?[ and note in particular A third form of indexing is via a numeric matrix with the one column for each dimension: each row of the index matrix then selects a single element of the array, and the result is a vector. Thus the result in this case should be a vector with element 1,3 as its

[Rd] http://cran.r-project.org/contrib/extra/

2006-10-18 Thread Gabor Grothendieck
I can't seem to find any way to get from the main R page to http://cran.r-project.org/contrib/extra/ via any series of links. Does such a path exist? Where is it? __ R-devel@r-project.org mailing list

[Rd] OmegaHat and install packages menu

2006-10-16 Thread Gabor Grothendieck
On Windows, if I set the repositories to only Omegahat using the Packages | Select repositories menu and then bring up the install packages menu: Packages | Install packages I find that several packages are listed twice. Why is that? I am using Windows XP: R version 2.4.0 Patched

Re: [Rd] No exit codes from RTerm (Windows) (PR#9296)

2006-10-13 Thread Gabor Grothendieck
I have an XP batch file that runs sweave and figures out whether to proceed by comparing the file dates on the .Rnw and .tex files (and also on the .tex and .pdf files). It will be included in the next version of the batchfiles project: http://cran.r-project.org/contrib/extra/batchfiles/

[Rd] Where to put sgml file

2006-10-09 Thread Gabor Grothendieck
I have a package that will have an sgml file. One of the demos in ./demo will use it. Where should I put it? I tried putting it in ./demo but it did not survive the build so currently I put it in ./inst and it gets copied to the same level as the DESCRIPTION file and the demo gets it from

Re: [Rd] CCF and ACF

2006-10-02 Thread Gabor Grothendieck
Using ts objects these can be written in the following consistent manner: sum(ts(x) * lag(ts(x)) / sum(ts(x)^2)) [1] -0.2648633 sum(ts(x) * lag(ts(y)) / sqrt(sum(ts(y)^2) * sum(ts(x)^2))) [1] 0.5930216 On 10/2/06, Simone Giannerini [EMAIL PROTECTED] wrote: Dear all, given two numeric

Re: [Rd] Rcmd install mypkg

2006-10-01 Thread Gabor Grothendieck
This would seem to violate the user interface stereotype that command lines are case insensitive on Windows. On 10/1/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 9/30/2006 10:54 PM, Gabor Grothendieck wrote: I noticed that in R version 2.4.0 alpha (2006-09-16 r39365) on Windows XP that I

Re: [Rd] Rcmd install mypkg

2006-10-01 Thread Gabor Grothendieck
On 10/1/06, Uwe Ligges [EMAIL PROTECTED] wrote: Gabor Grothendieck wrote: This would seem to violate the user interface stereotype that command lines are case insensitive on Windows. This is an improvement. R tries to be as unique as possible on all platforms. Not sure what the above

Re: [Rd] Rcmd install mypkg

2006-10-01 Thread Gabor Grothendieck
On 10/1/06, Dirk Eddelbuettel [EMAIL PROTECTED] wrote: On 1 October 2006 at 08:53, Gabor Grothendieck wrote: | On 10/1/06, Uwe Ligges [EMAIL PROTECTED] wrote: | Gabor Grothendieck wrote: | This would seem to violate the user interface stereotype that | command lines are case insensitive

Re: [Rd] Rcmd install mypkg

2006-10-01 Thread Gabor Grothendieck
On 10/1/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 10/1/2006 7:20 AM, Gabor Grothendieck wrote: This would seem to violate the user interface stereotype that command lines are case insensitive on Windows. And command options use a / prefix in Windows, but a - or -- prefix in R

Re: [Rd] Rcmd install mypkg

2006-10-01 Thread Gabor Grothendieck
On 10/1/06, Duncan Murdoch [EMAIL PROTECTED] wrote: So what I'd suggest you do if you find typing INSTALL to be painful is to install an alias or command script that wraps it up in a way that feels more comfortable to you. It would be possible to do some processing in Rcmd.bat in batchfiles

Re: [Rd] Rcmd install mypkg

2006-10-01 Thread Gabor Grothendieck
I think the really annoying thing is that it was changed for the worse. Why not just keep it how it was before? On 10/1/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 10/1/2006 4:30 PM, hadley wickham wrote: Requiring Perl script names to be specified in a case-sensitive way doesn't affect

[Rd] Rcmd install mypkg

2006-09-30 Thread Gabor Grothendieck
I noticed that in R version 2.4.0 alpha (2006-09-16 r39365) on Windows XP that I get this error: C:\RpkgsRcmd install mypkg no Perl script 'install' The same command worked with no error in 2.3.1pat. If I capitalize INSTALL it does work; however, this was not necessary previously. Note that

Re: [Rd] Warning: a final empty element has been omitted

2006-09-29 Thread Gabor Grothendieck
Here is a kludge: List - function(...) { mc - match.call() mc - mc[as.list(mc) != ] mc[[1]] - as.name(list) eval(mc, parent.frame()) } List(1,2,3,) On 9/29/06, hadley wickham [EMAIL PROTECTED] wrote: How can I suppress this warning? options(warn = -10)

Re: [Rd] Warning: a final empty element has been omitted

2006-09-29 Thread Gabor Grothendieck
By the way, this seems to be a difference between 2.3.1pat and 2.4.0 since I get the warning using list on R version 2.4.0 alpha (2006-09-16 r39365) but not on Version 2.3.1 Patched (2006-06-04 r38279) On 9/29/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: Here is a kludge: List - function

Re: [Rd] R CMD build when the package name is different from the directory name

2006-09-28 Thread Gabor Grothendieck
Another possibility is to store your code in svn or other version control system. On 9/28/06, Arne Henningsen [EMAIL PROTECTED] wrote: Hi, I was really happy when I saw that in R version 2.3.0 R CMD check works for packages whose package name is different from the directory name in which it

Re: [Rd] Warning on backslash sequences (was sprintf behavior)

2006-09-28 Thread Gabor Grothendieck
One area where a problem might appear is if one is generating R code, e.g. paste(a -, dQuote(xyz)) # wrong! since in UTF-8 dQuote (and sQuote) do not necessarily generate double quotes (and single quotes) so one winds up using double quotes within single quotes or else backslash-protected

Re: [Rd] R CMD build when the package name is different from the directory name

2006-09-28 Thread Gabor Grothendieck
for your message. On Thursday 28 September 2006 15:30, Gabor Grothendieck wrote: Another possibility is to store your code in svn or other version control system. Unfortunately, I can't see why this should make a difference for R CMD build. Do I miss something? The entire package is in an SVN

Re: [Rd] Warning on backslash sequences (was sprintf behavior)

2006-09-28 Thread Gabor Grothendieck
On 28 Sep 2006 16:33:17 +0200, Peter Dalgaard [EMAIL PROTECTED] wrote: Gabor Grothendieck [EMAIL PROTECTED] writes: One area where a problem might appear is if one is generating R code, e.g. paste(a -, dQuote(xyz)) # wrong! since in UTF-8 dQuote (and sQuote) do not necessarily

Re: [Rd] S3 methods for cbind/rbind

2006-09-27 Thread Gabor Grothendieck
Actually you can add your own method. See library(zoo) rbind.zoo for an example. On 9/27/06, Vincent Goulet [EMAIL PROTECTED] wrote: I created a type of object similar to a data frame. In some circumstances, It needs special methods for [ and [- and rbind() (but not cbind()). Then I found

Re: [Rd] S3 methods for cbind/rbind

2006-09-27 Thread Gabor Grothendieck
if there is an an applicable method. ... rbind(foo) is never sent to rbind.bar(). So I guess my questions stand. Le Mercredi 27 Septembre 2006 16:16, Gabor Grothendieck a écrit: Actually you can add your own method. See library(zoo) rbind.zoo for an example. On 9/27/06, Vincent Goulet [EMAIL

Re: [Rd] standardization of slot access

2006-09-26 Thread Gabor Grothendieck
I think the point is that if you use @ and then later redesign the internals of the class so that that component is not longer stored but is, instead, computed then @ will no longer be possible to use in that instance and a method call will be required which means that the internal change implies

Re: [Rd] An update method for lists?

2006-09-18 Thread Gabor Grothendieck
It would be nice if the .Rd file had one or more examples since its not that easy to otherwise understand what it does. Regards. On 9/18/06, Deepayan Sarkar [EMAIL PROTECTED] wrote: On 9/15/06, Deepayan Sarkar [EMAIL PROTECTED] wrote: On 9/15/06, Martin Maechler [EMAIL PROTECTED] wrote:

Re: [Rd] unexpected behaviour when defining a function

2006-09-12 Thread Gabor Grothendieck
You can't have x=x in an argument list. Try the following noting that we put a dot at the end of bar: bar - function() 1 foo - function(bar. = bar()) { + bar + } foo() function() 1 foo(bar = bar) function() 1 On 9/11/06, Deepayan Sarkar [EMAIL PROTECTED] wrote: Hi, I know S manuals

Re: [Rd] unexpected behaviour when defining a function

2006-09-12 Thread Gabor Grothendieck
Sorry I forgot one of the dots. Here it is corrected: bar - function() 1 foo - function(bar. = bar()) { + bar. + } foo() [1] 1 foo(bar = bar) function() 1 On 9/12/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: You can't have x=x in an argument list. Try the following noting that we

Re: [Rd] Extending [ method to S4 class and drop argument (PR#9211)

2006-09-08 Thread Gabor Grothendieck
Try this: setClass(test,representation(x=character)) [1] test setMethod([,test,function(x,i,j,...,drop) { +print(i) +if (missing(drop)) drop - TRUE +print(drop) + }) [1] [ a = new(test,x=fred) a[1] [1] 1 [1] TRUE On 9/8/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Full_Name:

Re: [Rd] lm, weights and ...

2006-09-03 Thread Gabor Grothendieck
If you change it to: lm3 - function(...) eval.parent(substitute(lm(...))) then it works. lm3(mpg ~ wt, weights=cyl, data=mtcars) Call: lm(formula = mpg ~ wt, data = mtcars, weights = cyl) Coefficients: (Intercept) wt 35.50-4.91 On 9/3/06, hadley wickham [EMAIL

Re: [Rd] Date conversion with as.POSIXct and as.POSIXlt (PR#9196)

2006-09-01 Thread Gabor Grothendieck
Note that there is some discussion in the help desk article in R News 4/1 and a table of tested conversions at the end of that article.If x is of class Date then for converting from Date to POSIXct the table suggests as.POSIXct(format(x)) or as.POSIXct(format(x), tz = GMT) according to whether

Re: [Rd] vector S4 classes

2006-08-29 Thread Gabor Grothendieck
You might want to look at the source for the R 'its' package. It defines an S4 class for an irregular time series whose representation consists of 1. a matrix portion analogous to your vector portion to hold the series of multivariate series, and 2. a dates slot analogous to your accurate

Re: [Rd] PATCH: Add fields argument to installed.packages and available.packages

2006-08-29 Thread Gabor Grothendieck
Rather than a plethora of fields, perhaps the Depends field could indicate what depends on the object: For example, if we use file extensions to indicate what is dependent then one might write this to indicate that some .Rd (i.e. examples) and .Rnw (i.e. vignette) files depend on lattice and the

Re: [Rd] Capturing warnings with capture.output

2006-08-29 Thread Gabor Grothendieck
Something like this which displays the warnings and also writes them to out so that they are captured: out - capture.output( withCallingHandlers({ print(1) warning(A warning.) print(2) warning(Another warning.) print(3) }, warning = function(x)

Re: [Rd] S4 classes and objects -- fixed structure? No...

2006-08-28 Thread Gabor Grothendieck
Under R 2.3.1 these work as you indicate but under R 2.4.0 they all give errors: setClass(track, representation(x=numeric, y=numeric)) [1] track tr - new( track ) tr[ ping ] - pong Error in [-(`*tmp*`, ping, value = pong) : object is not subsettable tr$bingo - bongo Error: cannot

Re: [Rd] [Bioc-devel] Sweave windows style path (was Re: texmf error on 7 packages on devel winXP build nodes)

2006-08-28 Thread Gabor Grothendieck
Have a look at Rfind.bat in http://cran.r-project.org/contrib/extra/batchfiles/ which uses the registry to find various software used by R. On 8/28/06, Friedrich Leisch [EMAIL PROTECTED] wrote: On Sun, 27 Aug 2006 07:45:00 -0700, Martin Morgan (MM) wrote: [A build system

Re: [Rd] Affiliation Reporting Standards. was: Re: reshape scaling with large numbers of times/rows

2006-08-28 Thread Gabor Grothendieck
I don't think you owe anyone any explanations or descriptions of yourself. The only thing you really need to provide is a good description of any problem you post as discussed on the r-help posting guide and as discussed in the single line at the bottom of every r-help message. On 8/28/06, David

Re: [Rd] + for character method...

2006-08-26 Thread Gabor Grothendieck
On 8/26/06, John Chambers [EMAIL PROTECTED] wrote: 1. I have to say that I find the idea of using + to paste character strings together aesthetically ugly. IMO, one thing that makes functional object-based languages attractive is that the generic function retains a consistent _function_,

Re: [Rd] + for character method...

2006-08-26 Thread Gabor Grothendieck
There are several problems with %+% : - %whatever% should be open for use by the user and if R starts taking them over they won't be - %+% is ugly - %+% is not consistent with other languages (the C-based syntax of R is supposed to leverage off one's knowledge of other languages)

Re: [Rd] reshape scaling with large numbers of times/rows

2006-08-24 Thread Gabor Grothendieck
If for each combination of X and Y there is at most one Z and Z is numeric (it could be made so in your example) then you could use xtabs which is faster: m - n - 10 DF - data.frame(X = gl(m*n, 1), Y = gl(m, n), Z = 10*(1:(n*m))) system.time(w1 - reshape(DF, timevar = X, idvar = Y, dir =

Re: [Rd] reshape scaling with large numbers of times/rows

2006-08-24 Thread Gabor Grothendieck
= X, idvar = Y, dir = wide)) system.time({Zn - as.numeric(DF$Z) w2 - xtabs(Zn ~ Y + X, DF) w2[w2 0] - levels(DF$Z)[w2] w2[w2 == 0] - NA }) On 8/24/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: If for each combination of X and Y there is at most one Z and Z is numeric (it could be made

Re: [Rd] reshape scaling with large numbers of times/rows

2006-08-24 Thread Gabor Grothendieck
On 8/24/06, Mitch Skinner [EMAIL PROTECTED] wrote: On Thu, 2006-08-24 at 08:57 -0400, Gabor Grothendieck wrote: If your Z in reality is not naturally numeric try representing it as a factor and using the numeric levels as your numbers and then put the level labels back on: m - n - 5

Re: [Rd] Strict seq: a recommendation

2006-08-23 Thread Gabor Grothendieck
This is a longstanding problem when programing with seq. In the common case that one wants 1,...,n such that if n is zero a zero length answer is wanted, one can write seq(length = n) instead of 1:n. However, the general case is still a problem, as you point out. On 8/23/06, Dominick Samperi

Re: [Rd] [R] Successive subsets from a vector?

2006-08-23 Thread Gabor Grothendieck
On 8/23/06, John Chambers [EMAIL PROTECTED] wrote: A different discussion is the desire to pass object references in R. There are in fact objects that currently act as references, notably environments. If one wants to, a general reference-semantic set of capabilities can be added to R,

[Rd] R svn log problem

2006-08-21 Thread Gabor Grothendieck
The R svn log usually available at: http://developer.r-project.org/R.svnlog.2006 seems to be missing. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] not a typo in list.Rd

2006-08-18 Thread Gabor Grothendieck
On 8/18/06, Martin Maechler [EMAIL PROTECTED] wrote: Gregor == Gregor Gorjanc [EMAIL PROTECTED] on Fri, 18 Aug 2006 14:48:40 +0200 writes: Gregor Hin-Tak Leung wrote: Gregor Gorjanc wrote: Hello! There is a tiny typo in list.Rd. Index:

[Rd] BOD causes error in 2.4.0

2006-08-10 Thread Gabor Grothendieck
Using R version 2.4.0 Under development (unstable) (2006-08-08 r38825) on Windows XP and starting in a fresh session we get an error if we type BOD. (There is no error in Version 2.3.1 Patched (2006-06-04 r38279).) BOD Error in data.frame(Time = c(1, 2), demand = c( 8.3, 10.3), check.names =

Re: [Rd] Documentation for S3 generics

2006-08-07 Thread Gabor Grothendieck
Exporting a method allows the user to access the method directly as opposed to calling the generic. For example, try: methods(plot) The methods listed with stars are not exported although they are still available through the generic. For example: plot(ts(1:10)) plot.ts(ts(1:10))

Re: [Rd] Documentation for S3 generics

2006-08-07 Thread Gabor Grothendieck
page. Gregor -Original Message- From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] Sent: Mon 2006-08-07 14:07 To: Gorjanc Gregor Cc: Martin Maechler; r-devel@stat.math.ethz.ch Subject: Re: [Rd] Documentation for S3 generics Exporting a method allows the user to access the method

Re: [Rd] proposal for lower.tri and upper.tri value argument

2006-08-06 Thread Gabor Grothendieck
On 8/6/06, Prof Brian Ripley [EMAIL PROTECTED] wrote: Is there a case to be made for this? If so, where is it? (I don't find x[lower.tri(x)] harder to write than lower.tri(x, value=TRUE), and wonder why you do? The reasons are 1. x might be the result of an expression. Without value= one

Re: [Rd] Can't make sort generic in quantile (S3)

2006-08-06 Thread Gabor Grothendieck
Try redefining quantile.default: environment(quantile.default) - .GlobalEnv For example, if you run the following in a fresh session it should print out X showing that the newly defined sort was invoked: environment(quantile.default) - .GlobalEnv sort - function(x, ...)

Re: [Rd] seq improperly increments dates (PR#9120)

2006-08-04 Thread Gabor Grothendieck
PROTECTED] wrote: Gabor == Gabor Grothendieck [EMAIL PROTECTED] on Thu, 3 Aug 2006 20:14:24 -0400 writes: Gabor That's, in fact, the way seq.dates works in the chron package: Gabor library(chron) Gabor x - chron(01/31/2006) Gabor seq(x, by = month, length = 2) # 01/31/06 02/28/06

Re: [Rd] how to test packages under platforms we don't have?

2006-08-04 Thread Gabor Grothendieck
When its on CRAN it will be checked on Windows with the result here: http://cran.r-project.org/bin/windows/contrib/checkSummaryWin.html although I guess you are really looking for some way to do this yourself. On 8/4/06, Kevin B. Hendricks [EMAIL PROTECTED] wrote: Hi, One final question ...

Re: [Rd] seq improperly increments dates (PR#9120)

2006-08-03 Thread Gabor Grothendieck
That's, in fact, the way seq.dates works in the chron package: library(chron) x - chron(01/31/2006) seq(x, by = month, length = 2) # 01/31/06 02/28/06 See the help desk article in R News 4/1 for more about the main date classes. On 8/3/06, Ponzio, Stephen [CIB-LAVA] [EMAIL PROTECTED] wrote:

Re: [Rd] Rigroup external package ready to go but no incoming at ftp site

2006-08-03 Thread Gabor Grothendieck
Its ftp://cran.r-project.org/incoming . Its listed at the bottom of: the mirrors page: http://cran.r-project.org/mirrors.html I just tried it and got connected. On 8/3/06, Kevin B. Hendricks [EMAIL PROTECTED] wrote: Hi, I found a web page that said to upload using ftp to cran.r-

Re: [Rd] Rigroup external package ready to go but no incoming at ftp site

2006-08-03 Thread Gabor Grothendieck
. That is what the debug log showed below. Can you upload things into incoming? Perhaps there is simply something funny about my ftp client? I will try from my MacOSX box once more just to check. Kevin On Aug 3, 2006, at 8:19 PM, Gabor Grothendieck wrote: Its ftp://cran.r-project.org

Re: [Rd] Structure of the object: list() and attr()

2006-08-01 Thread Gabor Grothendieck
The key issue is inheritance. If you use a data frame with attributes then you can inherit data frame methods without further definition, e.g. x - structure(data.frame(a = 1:10), my.attr = 33, class = c(myclass, data.frame)) dim(x) # inherit dim method but if you do it this way

Re: [Rd] Any interest in merge and by implementations specifically for sorted data?

2006-07-28 Thread Gabor Grothendieck
There was a performance comparison of several moving average approaches here: http://tolstoy.newcastle.edu.au/R/help/04/10/5161.html The author of that message ultimately wrote the caTools R package which contains some optimized versions. Not sure if these results suggest anything of interest

Re: [Rd] compiling packages for windows

2006-07-28 Thread Gabor Grothendieck
1. Check out: http://tolstoy.newcastle.edu.au/R/help/05/07/9167.html and the references there. 2. Also google for: making creating R package tutorial On 7/29/06, Ken Cheung [EMAIL PROTECTED] wrote: hi, i've put together some R codes and created a source package. i

Re: [Rd] largest acceptable lookup table in a package

2006-07-26 Thread Gabor Grothendieck
A frame of reference based on: http://cran.r-project.org/src/contrib is the quantiles of the size distribution of the compressed packages: 0% 5% 25% 50% 75% 95% 100% 58 58001700062500 249500 150 1500 On 7/26/06, Robin Hankin

Re: [Rd] pari/gp interface

2006-07-25 Thread Gabor Grothendieck
On Windows XP either of these work under R. Here echo and findstr are builtin Windows commands but you could substitute others: system(cmd /c echo abc | findstr a, intern = TRUE) shell(echo abc | findstr a, intern = TRUE) If its necessary to special case it then note that the R variable

Re: [Rd] How do I modify an exported function in a locked environment?

2006-07-20 Thread Gabor Grothendieck
As others have mentioned its not really a good idea to modify the namespace of a package and writing a wrapper as Duncan suggested is much preferable. An intermediate approach that is not as good as the wrapper but better than modifying the namespace is to copy the objects of interest to your

Re: [Rd] [R] put R on a web server

2006-07-16 Thread Gabor Grothendieck
Would be useful to have this list added to www.r-project.org web site or CRAN or failing that to the wiki. Sorry if its already there but I googled for the first URL and www.r-project.org and it came up blank. On 7/16/06, Jean lobry [EMAIL PROTECTED] wrote: Has anyone put R on a web server any

Re: [Rd] chron vs. POSIX

2006-07-15 Thread Gabor Grothendieck
On 7/14/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 7/14/2006 3:38 PM, Sebastian Luque wrote: Hi, One of the big decisions when writing code is how to handle dates and times. Gabor Grothendieck provided an excellent overview of the issue in his R News 4/1 (2004) article, and many

Re: [Rd] chron vs. POSIX

2006-07-15 Thread Gabor Grothendieck
On 7/15/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 7/15/2006 1:01 PM, Gabor Grothendieck wrote: On 7/14/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 7/14/2006 3:38 PM, Sebastian Luque wrote: Hi, One of the big decisions when writing code is how to handle dates and times. Gabor

Re: [Rd] chron vs. POSIX

2006-07-15 Thread Gabor Grothendieck
On 7/15/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 7/15/2006 1:37 PM, Gabor Grothendieck wrote: On 7/15/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 7/15/2006 1:01 PM, Gabor Grothendieck wrote: On 7/14/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 7/14/2006 3:38 PM, Sebastian Luque

<    3   4   5   6   7   8   9   10   >