[Rd] R 2.7.2 for Windows fails to install local zip package (PR#12612)

2008-08-27 Thread rubinson
R version 2.7.2 for Windows fails to install local (zipped) packages
with following messages:

> utils:::menuInstallLocal()
updating HTML package descriptions
Error in .readRDS(pfile) : error reading from connection
>

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


Re: [Rd] R 2.7.2 for Windows fails to install local zip package (PR#12612)

2008-08-27 Thread Duncan Murdoch

[EMAIL PROTECTED] wrote:

R version 2.7.2 for Windows fails to install local (zipped) packages
with following messages:

  

utils:::menuInstallLocal()


updating HTML package descriptions
Error in .readRDS(pfile) : error reading from connection
  
It works for me.  I suspect you have permissions problems. 


Duncan Murdoch

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


[Rd] S4 coercion

2008-08-27 Thread Paul Gilbert

I am extending a DBI connection by

setClass("TSPostgreSQLConnection", 
contains=c("PostgreSQLConnection","TSdbOptions"))


but the first time I use this I am getting a warning when it tries to 
coerce  the  TSPostgreSQLConnection to a PostgreSQLConnection. After the 
first use the warning stops,  but the first warning is causing me 
problems when I do automatic checks and set my tests to stop on 
warnings. (I think there should be a correct way to do this that does 
not produce a warning.)  I can trace it back by setting options(warn=2) 
as below.  Do I need to be more specific about how the coercion  
happens? If so, what is the correct way to coerce the 
TSPostgreSQLConnection into a PostgreSQLConnection? If not, how to a get 
rid of the warning?


Paul Gilbert


> TSdelete("vec", con)
Error: (converted from warning) Ambiguous method selection for "coerce", 
target "TSPostgreSQLConnection#integer" (the first of the signatures 
shown will be used)

  PostgreSQLConnection#integer
  dbObjectId#integer
> traceback()
15: doWithOneRestart(return(expr), restart)
14: withOneRestart(expr, restarts[[1]])
13: withRestarts({
  .Internal(.signalCondition(simpleWarning(msg, call), msg,
  call))
  .Internal(.dfltWarn(msg, call))
  }, muffleWarning = function() NULL)
12: .signalSimpleWarning("Ambiguous method selection for \"coerce\", 
target \"TSPostgreSQLConnection#integer\" (the first of the signatures 
shown will be used)\nPostgreSQLConnection#integer\n
dbObjectId#integer\n",

  quote(NULL))
11: warning(gettextf(paste("Ambiguous method selection for \"%s\", 
target \"%s\"",

  "(the first of the signatures shown will be used)\n%s\n"),
  [EMAIL PROTECTED], .sigLabel(classes), paste("   ", names(methods),
  collapse = "\n")), domain = NA, call. = FALSE)
10: .findInheritedMethods(signature, fdef, mtable = allmethods, table = 
mlist,

  useInherited = useInherited, verbose = verbose)
9: selectMethod("coerce", sig, optional = TRUE, c(from = TRUE, to = FALSE),
 fdef = coerceFun, mlist = coerceMethods)
8: as(obj, "integer")
7: isIdCurrent(con)
6: postgresqlQuickSQL(conn, statement, ...)
5: dbGetQuery(con, paste("SELECT tbl  FROM Meta ", where, ";"))
4: dbGetQuery(con, paste("SELECT tbl  FROM Meta ", where, ";"))
3: TSdbi:::TSdeleteSQL(serIDs = serIDs, con = con, ...)
2: TSdelete("vec", con)
1: TSdelete("vec", con)
>  str(con)
Formal class 'TSPostgreSQLConnection' [package "TSPostgreSQL"] with 4 slots
..@ Id : int [1:2] 21795 1
..@ dbname : chr "test"
..@ vintage: logi FALSE
..@ panel  : logi FALSE


La version française suit le texte anglais.



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

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


Re: [Rd] S4 coercion

2008-08-27 Thread Martin Morgan
Hi Paul -- does this make the problem more explicit?

> ## class hierarchy
> setClass("A", representation=representation(a="numeric"))
[1] "A"
> setClass("B", representation=representation(b="numeric"))
[1] "B"
> setClass("C", contains=c("A", "B"))
[1] "C"

> ## coerce methods -- in some instances implicitly created
> setAs("A", "numeric", function(from) slot(from, "a"))
> setAs("B", "numeric", function(from) slot(from, "b"))

> ## trouble: C equidistant from A, B so no unambiguous nearest 'coerce'
> ## method
> as(new("C"), "numeric")
numeric(0)
Warning message:
Ambiguous method selection for "coerce", target "C#numeric" (the first
of the signatures shown will be used)
A#numeric
B#numeric

The solution is to define a method to resolve the conflict, e.g.,

setAs("C", "numeric", function(from) {
## avoid breaking the class abstraction
as(as(from, "A"), "numeric") *
as(as(from, "B"), "numeric")
})

I don't know how you want to break your particular tie; that has to do
with the classes you're extending.

Martin

Paul Gilbert <[EMAIL PROTECTED]> writes:

> I am extending a DBI connection by
>
> setClass("TSPostgreSQLConnection",
> contains=c("PostgreSQLConnection","TSdbOptions"))
>
> but the first time I use this I am getting a warning when it tries to
> coerce  the  TSPostgreSQLConnection to a PostgreSQLConnection. After
> the first use the warning stops,  but the first warning is causing me
> problems when I do automatic checks and set my tests to stop on
> warnings. (I think there should be a correct way to do this that does
> not produce a warning.)  I can trace it back by setting
> options(warn=2) as below.  Do I need to be more specific about how the
> coercion  happens? If so, what is the correct way to coerce the
> TSPostgreSQLConnection into a PostgreSQLConnection? If not, how to a
> get rid of the warning?
>
> Paul Gilbert
>
>
>  > TSdelete("vec", con)
> Error: (converted from warning) Ambiguous method selection for
> "coerce", target "TSPostgreSQLConnection#integer" (the first of the
> signatures shown will be used)
>PostgreSQLConnection#integer
>dbObjectId#integer
>  > traceback()
> 15: doWithOneRestart(return(expr), restart)
> 14: withOneRestart(expr, restarts[[1]])
> 13: withRestarts({
>.Internal(.signalCondition(simpleWarning(msg, call), msg,
>call))
>.Internal(.dfltWarn(msg, call))
>}, muffleWarning = function() NULL)
> 12: .signalSimpleWarning("Ambiguous method selection for \"coerce\",
> target \"TSPostgreSQLConnection#integer\" (the first of the signatures
> shown will be used)\nPostgreSQLConnection#integer\n
> dbObjectId#integer\n",
>quote(NULL))
> 11: warning(gettextf(paste("Ambiguous method selection for \"%s\",
> target \"%s\"",
>"(the first of the signatures shown will be used)\n%s\n"),
>[EMAIL PROTECTED], .sigLabel(classes), paste("   ", names(methods),
>collapse = "\n")), domain = NA, call. = FALSE)
> 10: .findInheritedMethods(signature, fdef, mtable = allmethods, table
> = mlist,
>useInherited = useInherited, verbose = verbose)
> 9: selectMethod("coerce", sig, optional = TRUE, c(from = TRUE, to = FALSE),
>   fdef = coerceFun, mlist = coerceMethods)
> 8: as(obj, "integer")
> 7: isIdCurrent(con)
> 6: postgresqlQuickSQL(conn, statement, ...)
> 5: dbGetQuery(con, paste("SELECT tbl  FROM Meta ", where, ";"))
> 4: dbGetQuery(con, paste("SELECT tbl  FROM Meta ", where, ";"))
> 3: TSdbi:::TSdeleteSQL(serIDs = serIDs, con = con, ...)
> 2: TSdelete("vec", con)
> 1: TSdelete("vec", con)
>  >  str(con)
> Formal class 'TSPostgreSQLConnection' [package "TSPostgreSQL"] with 4 slots
>  ..@ Id : int [1:2] 21795 1
>  ..@ dbname : chr "test"
>  ..@ vintage: logi FALSE
>  ..@ panel  : logi FALSE
> 
>
> La version française suit le texte anglais.
>
> 
>
> This email may contain privileged and/or confidential in...{{dropped:26}}
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Martin Morgan
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M2 B169
Phone: (206) 667-2793

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


[Rd] format.data.frame handles names in nested data frames badly (PR#12624)

2008-08-27 Thread timhesterberg
> d <- data.frame(x=1:3, y=2:4)
> d[["r"]] <- d[1]/d[2]
> d
  x y x
1 1 2 0.500
2 2 3 0.667
3 3 4 0.750

It appears that the name "x" was given
instead of "r".  That is not correct:

> names(d)
[1] "x" "y" "r"
> showStructure(d) # from package splus2R
list[3,3]  S3 class: data.frame
 &row.names   numeric[ length 3]  class: integer
 $x   numeric[ length 3]  class: integer
 $y   numeric[ length 3]  class: integer
 $r   list[3,1]  S3 class: data.frame
   &row.names numeric[ length 3]  class: integer
   $x numeric[ length 3]  class: numeric

print.data.frame calls format.data.frame, which
loses the name "r" and substitutes the name "x".

I suggest that format.data.frame (or print.data.frame)
paste together the names, e.g.
  x y   r.x
1 1 2 0.500
2 2 3 0.667
3 3 4 0.750
This generalizes to the case that an included data frame
includes two columns.  It is also consistent with the
behavior for a data frame containing a matrix.

> d <- data.frame(x=1:3, y=2:4, A = I(cbind(a=3:5,b=4:6)))
> d
  x y A.a A.b
1 1 2   3   4
2 2 3   4   5
3 3 4   5   6
> showStructure(d)
list[3,3]  S3 class: data.frame
 &row.names   numeric[ length 3]  class: integer
 $x   numeric[ length 3]  class: integer
 $y   numeric[ length 3]  class: integer
 $A   numeric[3,2]  S3 class: AsIs
   attributes: dimnames

--please do not edit the information below--

Version:
 platform = i486-pc-linux-gnu
 arch = i486
 os = linux-gnu
 system = i486, linux-gnu
 status =
 major = 2
 minor = 7.1
 year = 2008
 month = 06
 day = 23
 svn rev = 45970
 language = R
 version.string = R version 2.7.1 (2008-06-23)

Locale:
LC_CTYPE=en_US;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=en_US;LC_PAPER=en_US;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US;LC_IDENTIFICATION=C

Search Path:
 .GlobalEnv, package:Rfixes, package:Rcode, package:aggregate,
package:stats, package:graphics, package:grDevices, package:utils,
package:datasets, package:showStructure, package:splus2R, package:methods,
Autoloads, package:base

[[alternative HTML version deleted]]

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


[Rd] standard errors for glm

2008-08-27 Thread christophe dutang
Hi,

I'm currently using biglm package to compute GLM outputs on a very large
dataset. But no function computes standard erros of predictions. I look in
what is done in R, namely in the function predict.glm.R in stats package.
In this function, we call predict.lm to compute the standard errors (line
51). The code of predict.lm (in lm.R) is very hard to understand.

I wonder if there is any good reference and / documentation on this topic?
the manual at http://www.nag.co.uk/numeric/cl/Manual/pdf/G02/g02gbc.pdfprovides
a good overview of the method used in R, but there is no reference
to standard errors...

I suppose this topic have already raised in the past, but I found only this
http://tolstoy.newcastle.edu.au/R/help/04/08/1762.html

Thanks in advance

Christophe

[[alternative HTML version deleted]]

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


[Rd] specifying compiler path in configure

2008-08-27 Thread Mark Kimpel
I'm having trouble building some packages while running Debian Lenny
(testing) and suspect that the issues are related to the default use
of gcc-4.3.  With Lenny, build-essentials depends on 4.3, so I'd like
to leave it installed but have also installed 4.2.1. How do I tell
./configure the path to 4.2.1 ? I"m sure it's an option, but I don't
see it documented in the R-admin manual.

Mark

-- 
Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry
Indiana University School of Medicine

15032 Hunter Court, Westfield, IN 46074

(317) 490-5129 Work, & Mobile & VoiceMail
(317) 663-0513 Home (no voice mail please)

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


Re: [Rd] specifying compiler path in configure

2008-08-27 Thread Prof Brian Ripley

On Wed, 27 Aug 2008, Mark Kimpel wrote:


I'm having trouble building some packages while running Debian Lenny
(testing) and suspect that the issues are related to the default use
of gcc-4.3.


You might want to compare your problems with the CRAN checks at

http://cran.r-project.org/web/checks/check_summary.html

as those are run with gcc 4.3.x on Debian testing.  From memory, the 
problems are confined to C++-(mis)using packages.



With Lenny, build-essentials depends on 4.3, so I'd like
to leave it installed but have also installed 4.2.1. How do I tell
./configure the path to 4.2.1 ? I"m sure it's an option, but I don't
see it documented in the R-admin manual.



From configure --help:


  CC  C compiler command
  CFLAGS  C compiler flags

There are many examples of setting CC in the R-admin manual, and the first 
para of 'Essential Programs' seems to me to tell you that as well.


--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

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


Re: [Rd] specifying compiler path in configure

2008-08-27 Thread Dirk Eddelbuettel

Mark,

On 27 August 2008 at 16:21, Mark Kimpel wrote:
| I'm having trouble building some packages while running Debian Lenny
| (testing) and suspect that the issues are related to the default use
| of gcc-4.3.  With Lenny, build-essentials depends on 4.3, so I'd like
| to leave it installed but have also installed 4.2.1. How do I tell
| ./configure the path to 4.2.1 ? I"m sure it's an option, but I don't
| see it documented in the R-admin manual.

a) That's an r-sig-debian question, so please post there. As a quick hint

   a.1) solve it the Debian way via alternatives: man update-alternatives

   a.2) solve it the standard Unix/GNU way by telling configure what to
use for CC, CXX, ...  The GNU tools respect those choices.

but 

b) All of Debian's r-cran-* package are built using the most current (ie now
   4.3) compiler; other had done complete archive rebuilds before 4.3 was
   released. The low-hanging fruits (ie easy errors of missing headers etc) 
   have all been addressed.

c) Just to lift the lid a little here, but our Google Summer of Code project
   is coming along just fine, thanks to outstanding work by Charles (the
   student) and now with hardware support from WU Wien which is letting us
   hammer away on Xen instance.  As of right now:

   [EMAIL PROTECTED]:~$ sqlite3 /var/cache/cran2deb/cran2deb.db "select 
count(package),success from builds group by success;"
   157|0
   1340|1
   [EMAIL PROTECTED]:~$ r -e'print(1340/(157+1340)*100)'
   [1] 89.51236
   [EMAIL PROTECTED]:~$ 

   89.9% autobuild and we're not quite done yet in terms of adding manual
   translations of SystemRequirements into Debian's Depends:

I suspect a local mishap at your end and invite you to post some details at
r-sig-debian -- I'm sure we get that sorted out.

Dirk

-- 
Three out of two people have difficulties with fractions.

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