[Rd] jpeg() and png() in R-2.4.x (PR#9423)

2006-12-20 Thread sophie . martin
I have tried to install R-2.4.x on my computer (linux - mandriva 2007 - 
64bits), with tar file for R-4.2.1 and rpm file for R-2.4.0, and 
function capabilities() says to me that JPG, PNG and TCLTK are not 
available. However, with the version R-2.3.x with whicc I work , they 
are available.
May be it's a bug, or may be my mandriva 2007 distribution are not all 
required libraries ? But I have not find "REQUIREMENTS" files on the 
CRAN site to verify that.

Thanks for your help,

Sophie Martin

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


Re: [Rd] preserving sparse matrices (Matrix)

2006-12-20 Thread Martin Maechler
Thank you, Tamas,

> "Tamas" == Tamas K Papp <[EMAIL PROTECTED]>
> on Tue, 19 Dec 2006 18:25:16 +0100 writes:

Tamas> Hi,
Tamas> I have sparse (tridiagonal) matrices, and I use the Matrix package 
for
Tamas> handling them.  For certain computations, I need to either set the
Tamas> first row to zero, or double the last row.  I find that neither
Tamas> operation preserves sparsity, eg

>> m <- Diagonal(5)
>> m
Tamas> 5 x 5 diagonal matrix of class "ddiMatrix"
Tamas> [,1] [,2] [,3] [,4] [,5]
Tamas> [1,]1....
Tamas> [2,].1...
Tamas> [3,]..1..
Tamas> [4,]...1.
Tamas> [5,]....1

showClass("ddiMatrix") 

will show you that 'm' is not a 'sparseMatrix' but a
'diagonalMatrix' which inherits from 'denseMatrix';
since I had decided that 'sparseMatrix' should be confined to
those matrices that store "location + content";
This is in line with the fact that a packed triangular matrix
also inherits from 'denseMatrix'.
(Also, to store a diagonalMatrix as sparseMatrix leads to larger
 object size).

I agree however that this is not obvious to the casual user and
also that you should not *have* to know this.

>> m[1,] <- 0
>> m
Tamas> 5 x 5 Matrix of class "dgeMatrix"
Tamas> [,1] [,2] [,3] [,4] [,5]
Tamas> [1,]00000
Tamas> [2,]01000
Tamas> [3,]00100
Tamas> [4,]00010
Tamas> [5,]00001
>> m <- Diagonal(5)
>> rbind(m,1:5)
Tamas> 6 x 5 Matrix of class "dgeMatrix"
Tamas> [,1] [,2] [,3] [,4] [,5]
Tamas> [1,]10000
Tamas> [2,]01000
Tamas> [3,]00100
Tamas> [4,]00010
Tamas> [5,]00001
Tamas> [6,]12345

Yes, this is an infelicity (and I'd say for the first example
even a bug) in the 'Matrix' package which I will fix for the
next version.

Tamas> Currently, I am calling Matrix to make these sparse again, but my
Tamas> matrices are large (100x100).  Is there a way to perform the
Tamas> operations I want without losing sparsity?

Yes --- however, not as easily as I thought for the current
version of 'Matrix' -- due to more infelicities... :

Here's a workable script {which has output as comments}:


m0 <- Diagonal(5)

### 1st problem : 

rbind(m0, 1:5)# -> dense

## Need this for now {not anymore in Matrix 0.9975-8 } :
.rb2m <- function(x, y) callGeneric(x, matrix(y, nrow = 1))
setMethod("rbind2", signature(x = "Matrix",y = "numeric"), .rb2m)
setMethod("rbind2", signature(x = "ddiMatrix", y = "numeric"), .rb2m)
setMethod("rbind2", signature(x = "ddiMatrix", y = "matrix"),
  function(x,y) rbind2(suppressWarnings(as(x,"CsparseMatrix")),
   Matrix:::as_Csparse(y)))

rbind(m0, 1:5)
## 6 x 5 sparse Matrix of class "dgCMatrix"

## [1,] 1 . . . .
## [2,] . 1 . . .
## [3,] . . 1 . .
## [4,] . . . 1 .
## [5,] . . . . 1
## [6,] 1 2 3 4 5

### 2nd problem: 

diag2Sparse <- function(x) ## this is a workaround for a current "Matrix" bug
Matrix:::diagU2N(suppressWarnings(as(x, "CsparseMatrix")))

m1 <- diag2Sparse(m0)
m1[1,] <- 0 ; m1
m1[,3] <- 3 ; m1
m1[1:3, 3] <- 0
m1
Matrix:::drop0(m1)# remove the "0"
## Should  drop0() be exported and documented? -- probably yes!


-

I hope this helps.

Next time, we (Prof Douglas Bates and me) will appreciate if you
approach us directly.

Best regards,
Martin

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


[Rd] DBI + ROracle problem with parser ?? (PR#9424)

2006-12-20 Thread christian . hoffmann
Full_Name: Christian Hoffmann
Version: 2.4.0
OS: Win 2000
Submission from: (NULL) (193.134.202.252)


Database queries using the combination DBI + ROracle are handicapped by 

quirks in the pipeline between the textual representation of the query 

and the database engine Oracle. Comments and linefeed at start are 
interfering:



dbGetQuery(conn, query):



works:

dbGetQuery(conn, "select * from dual")

dbGetQuery(conn, "select * from dual /* comment */")

dbGetQuery(conn, "select /* comment */ * from dual")



doesn't:

dbGetQuery(conn, "\nselect * from dual")

dbGetQuery(conn, "select\n * from dual")

dbGetQuery(conn, "/* comment */ select * from dual")

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


[Rd] Connections to https: URLs -- IE expert help needed

2006-12-20 Thread Prof Brian Ripley
I've added to R-devel the ability to use download.file() and url() to 
https: URLs, *only* if --internet2 is used on Windows.

This uses the Internet Explorer internals, and only works if the 
certificate is accepted (so e.g. does not work for 
https://svn.r-project.org).

Now I use IE (and Windows for that matter) only when really necessary, and 
Firefox has simple ways to permanently accept non-verifiable certificates. 
I would be grateful if someone who is much more familiar with IE could 
write a note explaining how to deal with this that we could add to the 
rw-FAQ.

To forestall the inevitable question: there are no plans to add https: 
support on any other platform, but it is something that would make a nice 
project for a user contribution.  The current internal code is based on 
likxml2, and that AFAICS still does not have https: support.

-- 
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


[Rd] Possible bug in cut.Date()

2006-12-20 Thread Martin Becker
Dear list,

I suppose that the behaviour of cut.Date() is not as intended for the 
case ' breaks="year" ' (in R 2.4.1 and previous versions):
The corresponding code fragment which defines the first breakpoint in 
this case reads:

if (valid == 4) {
start$mon <- 0
incr <- 366
}
 
So the month of the first breakpoint is set to January, but the day of 
month is not set to 1.
This leads to a strange behaviour, see the following example:

 > cut(as.Date(c("2000-01-17","2001-01-13","2001-01-20")),breaks="y")
[1] 2000-01-17 2000-01-17 2001-01-17
Levels: 2000-01-17 2001-01-17

I think, the code fragment above should better read:

if (valid == 4) {
start$mon <- 0
start$mday <- 1
incr <- 366
}

(Of course, maybe there are reasons for the current behaviour which I am 
not aware of, and the current behaviour is as intended.)

Regards,

  Martin

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


Re: [Rd] Connections to https: URLs -- IE expert help needed

2006-12-20 Thread Duncan Temple Lang
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



Prof Brian Ripley wrote:
> I've added to R-devel the ability to use download.file() and url() to 
> https: URLs, *only* if --internet2 is used on Windows.
> 
> This uses the Internet Explorer internals, and only works if the 
> certificate is accepted (so e.g. does not work for 
> https://svn.r-project.org).
> 
> Now I use IE (and Windows for that matter) only when really necessary, and 
> Firefox has simple ways to permanently accept non-verifiable certificates. 
> I would be grateful if someone who is much more familiar with IE could 
> write a note explaining how to deal with this that we could add to the 
> rw-FAQ.
> 
> To forestall the inevitable question: there are no plans to add https: 
> support on any other platform, but it is something that would make a nice 
> project for a user contribution.  The current internal code is based on 
> likxml2, and that AFAICS still does not have https: support.
> 

Generally (i.e. not in particular response to Brian but related to this
thread)

An alternative is to use RCurl and leave HTTPS and a host
of other protocols and details to an external library (e.g. libcurl,
libwww, etc.) and an R package that interfaces to it.

If we want the facilities to be accessible via the connections
interface, then we can make that API extensible by packages.
Jeff Horner has a proposal on that.

Generally, it is important if R is to continue to evolve that the R
internals become extensible by package developers so that we can do some
new experiments and provide alternative implementations of the basic
structures rather than being tied to the existing representation.
An object oriented framework underlying the R source code would enable
this and would solve numerous problems that have arisen recently
and I strongly suspect many more that will arise.

 D.


- --
Duncan Temple Lang[EMAIL PROTECTED]
Department of Statistics  work:  (530) 752-4782
4210 Mathematical Sciences Building   fax:   (530) 752-7099
One Shields Ave.
University of California at Davis
Davis,
CA 95616,
USA
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.3 (Darwin)

iD8DBQFFibTh9p/Jzwa2QP4RAgBiAJ9YojjDf0DMIo9FQ7yW1MiMdANvogCfRgCX
zci7UsavJESdidbyiCl2Xgw=
=HiuE
-END PGP SIGNATURE-

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


Re: [Rd] Bug in rt() ? (PR#9422)

2006-12-20 Thread goodrich
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Prof Brian Ripley wrote:
> Why do you consider this might be a bug in R rather than in your
> expectations?  Your 'expected' is not what others have expected 

Thank you for this response. I did consider at the time that this
unexpected result could be deliberate, but help(rt) on 2.4.1 seemed to
confirm my expectations. Martin Maechler noted on the first response to
this bug report that help(rt) was not updated to describe the new
functionality of rt().

> In 2.4.1  rt(ncp) operates continuously as ncp is varied through 0.
> That is different from saying that you want a central t (omitting ncp).

I was not expecting random draws from a central t distribution to be the
same as random draws from a limiting case of a non-central t
distribution. I was expecting that redundantly typing the default
arguments of a function would produce the same result as omitting the
default arguments. Are there other functions with this discrepancy?

In other words, I do not understand why rt() continues to default to ncp
= 0, as opposed to no default argument for ncp. It would seem that
args(rt) currently implies that the draws are to be taken from a
limiting case of non-central t distribution, when this is not accurate
if the ncp argument is omitted.

Thanks,
Ben

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFid58zQDSXIcN85kRAhRVAJ0WNf2fMVcPZk4rfxw8qXO272Bs8ACfdVAt
a5OaqyObzqkjL8a5sCooj6w=
=/fPt
-END PGP SIGNATURE-

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


[Rd] R windows crash (PR#9426)

2006-12-20 Thread robert . denham
Full_Name: Robert Denham
Version: R-2.4.1
OS: Windows Xp
Submission from: (NULL) (61.88.57.1)


R gui exits without warning when I run a function which has an argument with a
default that is not found.  

This was a result of an error in a function I wrote, but I thought that it
should exit more gracefully than it does. Here is an example:


testfun <- function(aa=aa) {
aa <- lm(y~x,data=aa)
return(aa)
}

testfun() #R then exits.

Note that 

testfun <- function(aa=bb) {
aa <- lm(y~x,data=aa)
return(aa)
}

works as it should, giving "object bb not found".

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


[Rd] Missing install libraries for R on OpenSuse 10.2 (PR#9425)

2006-12-20 Thread matjaz . jeran
Full_Name: Matjaž Jeran
Version: R-base-2.4.1-2.1.i58
OS: OpenSuse linux 10.2
Submission from: (NULL) (85.10.21.55)


I have a FRESH installation of Opensuse linux 10.2
I have downloaded R from http://cran.at.r-project.org/bin/linux/suse/10.2/
When I tried to install it the message about missing dependencies appeared:

error: Failed dependencies:
blas is needed by R-base-2.4.1-2.1.i586
libgfortran.so.1 is needed by R-base-2.4.1-2.1.i586

The error probably appears because fortran is not included in the suse distro
any more (as e.g in 10.1). I suggest to include the missing libraries in R
package.

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


Re: [Rd] Missing install libraries for R on OpenSuse 10.2 (PR#9425)

2006-12-20 Thread Benilton Carvalho
Hi Matjaz,

I don't see that as a bug. Instead, you don't have the requirements,  
as you already noticed.

Isn't it simpler just to install the requirements?

See:

http://download.opensuse.org/distribution/10.2/repo/oss/suse/i586/

best,
benilton

On Dec 20, 2006, at 2:04 PM, [EMAIL PROTECTED] wrote:

> Full_Name: Matjaž Jeran
> Version: R-base-2.4.1-2.1.i58
> OS: OpenSuse linux 10.2
> Submission from: (NULL) (85.10.21.55)
>
>
> I have a FRESH installation of Opensuse linux 10.2
> I have downloaded R from http://cran.at.r-project.org/bin/linux/ 
> suse/10.2/
> When I tried to install it the message about missing dependencies  
> appeared:
>
> error: Failed dependencies:
>   blas is needed by R-base-2.4.1-2.1.i586
>   libgfortran.so.1 is needed by R-base-2.4.1-2.1.i586
>
> The error probably appears because fortran is not included in the  
> suse distro
> any more (as e.g in 10.1). I suggest to include the missing  
> libraries in R
> package.
>
> __
> 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] jpeg() and png() in R-2.4.x (PR#9423)

2006-12-20 Thread ripley
The file INSTALL says

   The main source of information on installation is the `R Installation
   and Administration Manual', an HTML copy of which is available as file
   `doc/html/R-admin.html'.  Please read that before installing R.  But
   if you are impatient, read on but please refer to the manual to
   resolve any problems.  (If you obtained R using Subversion, the manual
   is at doc/manual/R-admin.texi.)

I suspect this was an installation problem, in which case it is covered in 
that manual.  Configure reports on the capabilities it found, e.g.

   Interfaces supported:  X11, tcltk
   External libraries:readline
   Additional capabilities:   PNG, JPEG, iconv, MBCS, NLS
   Options enabled:   shared BLAS, R profiling, Java

and you have not told us what your build reported.

An alternative is covered by ?capabilities

  X11: (Unix)  Are the 'X11' graphics device and the X11-based data
   editor available?  This loads the X11 module if not already
   loaded, and checks that the default display can be contacted
   unless a 'X11' device has already been used.

which if false will imply that jpeg and png are not available (but tcltk 
could be).

You need to demonstrate that this really is a bug in R and not a 
mis-report using scarce resources (R-core time).  (The R build not 
magically finding missing components of your OS is not a bug.)


On Wed, 20 Dec 2006, [EMAIL PROTECTED] wrote:

> I have tried to install R-2.4.x on my computer (linux - mandriva 2007 -
> 64bits), with tar file for R-4.2.1 and rpm file for R-2.4.0, and
> function capabilities() says to me that JPG, PNG and TCLTK are not
> available. However, with the version R-2.3.x with whicc I work , they
> are available.
> May be it's a bug, or may be my mandriva 2007 distribution are not all
> required libraries ? But I have not find "REQUIREMENTS" files on the
> CRAN site to verify that.
>
> Thanks for your help,
>
> Sophie Martin

-- 
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