[Rd] Extract/format/show for S4 objects

2010-06-08 Thread Johann Hibschman
Hi all,

I'm trying to make an integer-backed quarter (as in fraction of year)
class, but I can't quite it to work.  I want integer-backed so I don't
have to worry about floating-point effects when doing math, and so that
I can use it as in data.table.

First of all, is there a good reference for this anywhere?  All of the
S4 tutorials that I've found have been too high-level, and I can't find
any examples of implementing extract.  In S3, I can use [.Date as my
example, but I can't find the equivalent for S4.

Second, is this misguided?

Now for the details.  Given this start:

  library(zoo) # borrowing yearqtr for output.
  setClass("iqtr", contains="integer")
  ## Create an iqtr object from a numeric date (e.g. 2000.5).
  iqtr <- function (x) {
iq <- as.integer(floor((as.numeric(x) - 2000) * 4 + 0.0001))
new("iqtr", iq)
  }
  setMethod("show", "iqtr4",
function (object) {
  cat(format(yearqtr(as.numeric(x) * 0.25 + 2000)))
})


I have two issues:

  1. Vectors of iqtrs do not display properly.
 They print, but they don't look like vectors.
   > iq <- iqtr(seq(2000, 2002, 0.25))
   > iq
   2000 Q2 2000 Q2 2000 Q3 2000 Q4 2001 Q2 2002 Q1> 

  2. Subsets do not stay in the class.
   > iq[1:2]
   > [1] 0 1

Clearly, I'm just not understanding what's going on.  Is there a guide
for how to make printing, format, subsetting, etc., all work for S4
classes?

Thanks,
Johann

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


Re: [Rd] Extract/format/show for S4 objects

2010-06-08 Thread Gabor Grothendieck
The yearqtr class already rounds off automatically to avoid floating
point effects and handles #1 and #2.

On the other hand if you are just interested in playing around with S4
for its own sake review the source code of the mondate package as an
example of an S4 based date package.

On Tue, Jun 8, 2010 at 10:08 AM, Johann Hibschman  wrote:
> Hi all,
>
> I'm trying to make an integer-backed quarter (as in fraction of year)
> class, but I can't quite it to work.  I want integer-backed so I don't
> have to worry about floating-point effects when doing math, and so that
> I can use it as in data.table.
>
> First of all, is there a good reference for this anywhere?  All of the
> S4 tutorials that I've found have been too high-level, and I can't find
> any examples of implementing extract.  In S3, I can use [.Date as my
> example, but I can't find the equivalent for S4.
>
> Second, is this misguided?
>
> Now for the details.  Given this start:
>
>  library(zoo) # borrowing yearqtr for output.
>  setClass("iqtr", contains="integer")
>  ## Create an iqtr object from a numeric date (e.g. 2000.5).
>  iqtr <- function (x) {
>    iq <- as.integer(floor((as.numeric(x) - 2000) * 4 + 0.0001))
>    new("iqtr", iq)
>  }
>  setMethod("show", "iqtr4",
>            function (object) {
>              cat(format(yearqtr(as.numeric(x) * 0.25 + 2000)))
>            })
>
>
> I have two issues:
>
>  1. Vectors of iqtrs do not display properly.
>     They print, but they don't look like vectors.
>       > iq <- iqtr(seq(2000, 2002, 0.25))
>       > iq
>       2000 Q2 2000 Q2 2000 Q3 2000 Q4 2001 Q2 2002 Q1>
>
>  2. Subsets do not stay in the class.
>       > iq[1:2]
>       > [1] 0 1
>
> Clearly, I'm just not understanding what's going on.  Is there a guide
> for how to make printing, format, subsetting, etc., all work for S4
> classes?
>
> Thanks,
> Johann
>
> __
> 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] Question on trying to build R 2.11.1 on Tru64(aka OSF1) system

2010-06-08 Thread Bill . Glessner

Hello,

I am trying to build the R-2.11.1 software for university faculty to use in
research projects on a DEC/Compaq/HP AlphaServer model GS160 16CPU/64GB memory
running Tru64Unix aka OSF1 version 5.1B-5.
Is it known whether it is possible to build the R-2.11.1 software on the 
platform I am using? 
In my attempts to build the R-2.11.1 software, I first used the native C 
and Fortran 77/90/95 components and GNU make version 3.81:

# cc -V
Compaq C V6.5-011 on HP Tru64 UNIX V5.1B (Rev. 2650)
Compiler Driver V6.5-003 (sys) cc Driver
# f77 -version
 HP Fortran V5.6-104654
 HP Fortran Compiler V5.6-104654-48F7C
# f90 -version
 HP Fortran V5.6-104654
 HP Fortran Compiler V5.6-104654-48F7C
# f95 -version
 HP Fortran V5.6-104654
 HP Fortran Compiler V5.6-104654-48F7C

The build was configured with the command:

./configure "ac_cv_prog_cc_c99=" --prefix=/usr/local/R --disable-nls \
 --with-readline --with-libpng --with-jpeglib \
 --with-system-zlib --with-system-bzlib --with-system-pcre \
 --with-system-xz --with-recommended-packages

The configure executed successfully.
The build attempt exited with an error:

gnumake[1]: Entering directory `/usrX/JunqueYard/R-2.11.1/src/library/Recommende
d'
gnumake[2]: Entering directory `/usrX/JunqueYard/R-2.11.1/src/library/Recommende
d'
begin installing recommended package MASS
/usrX/JunqueYard/R-2.11.1/bin/Rcmd: @: not found
gnumake[2]: *** [MASS.ts] Error 1
gnumake[2]: Leaving directory `/usrX/JunqueYard/R-2.11.1/src/library/Recommended
'
gnumake[1]: *** [recommended-packages] Error 2
gnumake[1]: Leaving directory `/usrX/JunqueYard/R-2.11.1/src/library/Recommended
'
gnumake: *** [stamp-recommended] Error 2

With the configure command:

./configure "ac_cv_prog_cc_c99=" --prefix=/usr/local/R --disable-nls \
 --with-readline --with-libpng --with-jpeglib \
 --with-system-zlib --with-system-bzlib --with-system-pcre \
 --with-system-xz --with-recommended-packages=no

the build completes successfully, but the 'gnumake check' fails with the 
same error

"/usrX/JunqueYard/R-2.11.1/bin/Rcmd: @: not found"

The second attempt was made using gcc/gfortran:

# gcc --version
gcc (GCC) 4.0.2 (TWW)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# gfortran --version
GNU Fortran 95 (GCC 4.0.2 (TWW))
Copyright (C) 2005 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING

The build was configured with the command:

./configure --prefix=/usr/local/R --disable-nls \
 --with-readline --with-libpng --with-jpeglib \
 --with-system-zlib --with-system-bzlib --with-system-pcre \
 --with-system-xz --with-recommended-packages

The configure executed successfully.
The build attempt exited with the same error as attempt 1.
Running ./configure with "--with-recommended-packages=no" again allows the
build to complete successfully, but with the same error

"/usrX/JunqueYard/R-2.11.1/bin/Rcmd: @: not found"

as before when trying 'gnumake check'.
Although the 'gnumake check' didn't, I did a 'gnumake install'. The R
environment seems to work; however, anything involving packages fails
with the "/usrX/JunqueYard/R-2.11.1/bin/Rcmd: @: not found".

Can anyone suggest what I am doing incorrectly in configuring/building R?

The config.site file follows:
#! /bin/sh

### This file is part of R.
###
### R is free software; you can redistribute it and/or modify it under
### the terms of the GNU General Public License as published by the Free
### Software Foundation; either version 2 of the License, or (at your
### option) any later version.
###
### R is distributed in the hope that it will be useful, but WITHOUT ANY
### WARRANTY; without even the implied warranty of MERCHANTABILITY or
### FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
### License for more details.
###
### You should have received a copy of the GNU General Public License
### along with R; if not, a copy is available at
### http://www.r-project.org/Licenses/

## By means of this file you can (also) provide default values for the
## configuration process.  To set variables, uncomment the VAR=DEFAULT
## lines and set DEFAULT according to your needs.
## See etc/Renviron.in for further variables you may wish to set.

## The command used to spool PostScript files to the printer.
## If unspecified, the system will look for either 'lpr' or 'lp'.
## R_PRINTCMD=lpr
R_PRINTCMD=lpr

## The paper size for the local (PostScript) printer.
## It must either be left blank or set to one of 'a4' or 'letter'.
## If left blank the system will use 'a4'.
## R_PAPERSIZE=a4
R_PAPERSIZE=letter

## Set the default behavior of R when ending a session
## Set this to one of '--save' or '--no-save' depending 

Re: [Rd] Question on trying to build R 2.11.1 on Tru64(aka OSF1) system

2010-06-08 Thread Prof Brian Ripley

On Tue, 8 Jun 2010, bill.gless...@cwu.edu wrote:



Hello,

I am trying to build the R-2.11.1 software for university faculty to use in
research projects on a DEC/Compaq/HP AlphaServer model GS160 16CPU/64GB memory
running Tru64Unix aka OSF1 version 5.1B-5.
Is it known whether it is possible to build the R-2.11.1 software on the
platform I am using?


It is not known: it is years since we have a report on that system.

You seem to have a problem with Rcmd, that is R_HOME/bin/Rcmd. 
Perhaps you could send it to us to have a look at?



In my attempts to build the R-2.11.1 software, I first used the native C
and Fortran 77/90/95 components and GNU make version 3.81:

# cc -V
Compaq C V6.5-011 on HP Tru64 UNIX V5.1B (Rev. 2650)
Compiler Driver V6.5-003 (sys) cc Driver
# f77 -version
HP Fortran V5.6-104654
HP Fortran Compiler V5.6-104654-48F7C
# f90 -version
HP Fortran V5.6-104654
HP Fortran Compiler V5.6-104654-48F7C
# f95 -version
HP Fortran V5.6-104654
HP Fortran Compiler V5.6-104654-48F7C

The build was configured with the command:

./configure "ac_cv_prog_cc_c99=" --prefix=/usr/local/R --disable-nls \
--with-readline --with-libpng --with-jpeglib \
--with-system-zlib --with-system-bzlib --with-system-pcre \
--with-system-xz --with-recommended-packages

The configure executed successfully.
The build attempt exited with an error:

gnumake[1]: Entering directory `/usrX/JunqueYard/R-2.11.1/src/library/Recommende
d'
gnumake[2]: Entering directory `/usrX/JunqueYard/R-2.11.1/src/library/Recommende
d'
begin installing recommended package MASS
/usrX/JunqueYard/R-2.11.1/bin/Rcmd: @: not found
gnumake[2]: *** [MASS.ts] Error 1
gnumake[2]: Leaving directory `/usrX/JunqueYard/R-2.11.1/src/library/Recommended
'
gnumake[1]: *** [recommended-packages] Error 2
gnumake[1]: Leaving directory `/usrX/JunqueYard/R-2.11.1/src/library/Recommended
'
gnumake: *** [stamp-recommended] Error 2

With the configure command:

./configure "ac_cv_prog_cc_c99=" --prefix=/usr/local/R --disable-nls \
--with-readline --with-libpng --with-jpeglib \
--with-system-zlib --with-system-bzlib --with-system-pcre \
--with-system-xz --with-recommended-packages=no

the build completes successfully, but the 'gnumake check' fails with the
same error

"/usrX/JunqueYard/R-2.11.1/bin/Rcmd: @: not found"

The second attempt was made using gcc/gfortran:

# gcc --version
gcc (GCC) 4.0.2 (TWW)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# gfortran --version
GNU Fortran 95 (GCC 4.0.2 (TWW))
Copyright (C) 2005 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING

The build was configured with the command:

./configure --prefix=/usr/local/R --disable-nls \
--with-readline --with-libpng --with-jpeglib \
--with-system-zlib --with-system-bzlib --with-system-pcre \
--with-system-xz --with-recommended-packages

The configure executed successfully.
The build attempt exited with the same error as attempt 1.
Running ./configure with "--with-recommended-packages=no" again allows the
build to complete successfully, but with the same error

"/usrX/JunqueYard/R-2.11.1/bin/Rcmd: @: not found"

as before when trying 'gnumake check'.
Although the 'gnumake check' didn't, I did a 'gnumake install'. The R
environment seems to work; however, anything involving packages fails
with the "/usrX/JunqueYard/R-2.11.1/bin/Rcmd: @: not found".

Can anyone suggest what I am doing incorrectly in configuring/building R?

The config.site file follows:
#! /bin/sh

### This file is part of R.
###
### R is free software; you can redistribute it and/or modify it under
### the terms of the GNU General Public License as published by the Free
### Software Foundation; either version 2 of the License, or (at your
### option) any later version.
###
### R is distributed in the hope that it will be useful, but WITHOUT ANY
### WARRANTY; without even the implied warranty of MERCHANTABILITY or
### FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
### License for more details.
###
### You should have received a copy of the GNU General Public License
### along with R; if not, a copy is available at
### http://www.r-project.org/Licenses/

## By means of this file you can (also) provide default values for the
## configuration process.  To set variables, uncomment the VAR=DEFAULT
## lines and set DEFAULT according to your needs.
## See etc/Renviron.in for further variables you may wish to set.

## The command used to spool PostScript files to the printer.
## If unspecified, the system will look for either 'lpr' or 'lp'.
## R_PRINTCMD=lpr
R_PRINTCMD=lpr

## The paper size for the local (PostScript) printer.
## It must either be left blank or se

Re: [Rd] Question on trying to build R 2.11.1 on Tru64(aka OSF1) system

2010-06-08 Thread Bill . Glessner

Here is the Rcmd from the ./bin subdirectory of the build tree
/usrX/JunqueYard/R-2.11.1:

#!/bin/ksh
#
# ${R_HOME}/bin/Rcmd

## Shell script wrapper for all R CMD commands.
## For internal use only.

R_CMD="${R_HOME}/bin/Rcmd"
export R_CMD

R_VERSION=2.11.1
export R_VERSION

R_OSTYPE="unix"
export R_OSTYPE

## Add 'share/perl' to the perl library path.
if test -n "${PERL5LIB}"; then
  PERL5LIB="${R_SHARE_DIR}/perl:${PERL5LIB}"
  export PERL5LIB
else
  PERLLIB="${R_SHARE_DIR}/perl:${PERLLIB}"
  export PERLLIB
fi

## Append 'share/texmf' to TeX's input search path.
if test -z "$TEXINPUTS}"; then
  TEXINPUTS=".:${R_SHARE_DIR}/texmf:"
else
  TEXINPUTS=".:${TEXINPUTS}:${R_SHARE_DIR}/texmf:"
fi
export TEXINPUTS

. "${R_HOME}/etc${R_ARCH}/Renviron"
export `sed 's/^ *#.*//; s/^\(.*\)=.*/\1/' "${R_HOME}/etc${R_ARCH}/Renviron"`

extra=
case "${1}" in
  perl)
cmd="${PERL}" ;;
  awk)
cmd="${AWK}"  ;;
## this was a separate command prior to 2.10.0
  Rd2txt)
cmd="${R_HOME}/bin/Rdconv"
extra="-t txt"
;;
  Rd2pdf)
cmd="${R_HOME}/bin/Rd2dvi"
extra="--pdf"
;;
  *)
if test -x "${R_HOME}/bin/${1}"; then
  cmd="${R_HOME}/bin/${1}"
else
  cmd="${1}"
fi
;;
esac
shift

exec "${cmd}" ${extra} "$...@}"

### Local Variables: ***
### mode: sh ***
### sh-indentation: 2 ***
### End: ***

Bill

>Return-path: 
>Date: Tue, 08 Jun 2010 19:41:05 +0100 (BST)
>From: Prof Brian Ripley 
>Subject: Re: [Rd] Question on trying to build R 2.11.1 on Tru64(aka OSF1) 
>system
>To: bill.gless...@cwu.edu
>Cc: r-devel@r-project.org
>
>On Tue, 8 Jun 2010, bill.gless...@cwu.edu wrote:
>
>>
>> Hello,
>>
>> I am trying to build the R-2.11.1 software for university faculty to use in
>> research projects on a DEC/Compaq/HP AlphaServer model GS160 16CPU/64GB 
>> memory
>> running Tru64Unix aka OSF1 version 5.1B-5.
>> Is it known whether it is possible to build the R-2.11.1 software on the
>> platform I am using?
>
>It is not known: it is years since we have a report on that system.
>
>You seem to have a problem with Rcmd, that is R_HOME/bin/Rcmd. 
>Perhaps you could send it to us to have a look at?
>
>> ...snip...
>> __
>> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>
>-- 
>Brian D. Ripley,  rip...@stats.ox.ac.uk
>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] Question on trying to build R 2.11.1 on Tru64(aka OSF1)system

2010-06-08 Thread William Dunlap
Isn't the bash syntax
   "$...@}"
equivalent to just
   "$@"
and older versions of sh may not understand
the former version.  If so, you might have
similar problems with
   "${1}"
instead of
   "$1" 

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com  

> -Original Message-
> From: r-devel-boun...@r-project.org 
> [mailto:r-devel-boun...@r-project.org] On Behalf Of 
> bill.gless...@cwu.edu
> Sent: Tuesday, June 08, 2010 1:20 PM
> To: r-devel@r-project.org
> Subject: Re: [Rd] Question on trying to build R 2.11.1 on 
> Tru64(aka OSF1)system
> 
> 
> Here is the Rcmd from the ./bin subdirectory of the build tree
> /usrX/JunqueYard/R-2.11.1:
> 
> #!/bin/ksh
> #
> # ${R_HOME}/bin/Rcmd
> 
> ## Shell script wrapper for all R CMD commands.
> ## For internal use only.
> 
> R_CMD="${R_HOME}/bin/Rcmd"
> export R_CMD
> 
> R_VERSION=2.11.1
> export R_VERSION
> 
> R_OSTYPE="unix"
> export R_OSTYPE
> 
> ## Add 'share/perl' to the perl library path.
> if test -n "${PERL5LIB}"; then
>   PERL5LIB="${R_SHARE_DIR}/perl:${PERL5LIB}"
>   export PERL5LIB
> else
>   PERLLIB="${R_SHARE_DIR}/perl:${PERLLIB}"
>   export PERLLIB
> fi
> 
> ## Append 'share/texmf' to TeX's input search path.
> if test -z "$TEXINPUTS}"; then
>   TEXINPUTS=".:${R_SHARE_DIR}/texmf:"
> else
>   TEXINPUTS=".:${TEXINPUTS}:${R_SHARE_DIR}/texmf:"
> fi
> export TEXINPUTS
> 
> . "${R_HOME}/etc${R_ARCH}/Renviron"
> export `sed 's/^ *#.*//; s/^\(.*\)=.*/\1/' 
> "${R_HOME}/etc${R_ARCH}/Renviron"`
> 
> extra=
> case "${1}" in
>   perl)
> cmd="${PERL}" ;;
>   awk)
> cmd="${AWK}"  ;;
> ## this was a separate command prior to 2.10.0
>   Rd2txt)
> cmd="${R_HOME}/bin/Rdconv"
> extra="-t txt"
> ;;
>   Rd2pdf)
> cmd="${R_HOME}/bin/Rd2dvi"
> extra="--pdf"
> ;;
>   *)
> if test -x "${R_HOME}/bin/${1}"; then
>   cmd="${R_HOME}/bin/${1}"
> else
>   cmd="${1}"
> fi
> ;;
> esac
> shift
> 
> exec "${cmd}" ${extra} "$...@}"
> 
> ### Local Variables: ***
> ### mode: sh ***
> ### sh-indentation: 2 ***
> ### End: ***
> 
> Bill
> 
> >Return-path: 
> >Date: Tue, 08 Jun 2010 19:41:05 +0100 (BST)
> >From: Prof Brian Ripley 
> >Subject: Re: [Rd] Question on trying to build R 2.11.1 on 
> Tru64(aka OSF1) system
> >To: bill.gless...@cwu.edu
> >Cc: r-devel@r-project.org
> >
> >On Tue, 8 Jun 2010, bill.gless...@cwu.edu wrote:
> >
> >>
> >> Hello,
> >>
> >> I am trying to build the R-2.11.1 software for university 
> faculty to use in
> >> research projects on a DEC/Compaq/HP AlphaServer model 
> GS160 16CPU/64GB memory
> >> running Tru64Unix aka OSF1 version 5.1B-5.
> >> Is it known whether it is possible to build the R-2.11.1 
> software on the
> >> platform I am using?
> >
> >It is not known: it is years since we have a report on that system.
> >
> >You seem to have a problem with Rcmd, that is R_HOME/bin/Rcmd. 
> >Perhaps you could send it to us to have a look at?
> >
> >> ...snip...
> >> __
> >> R-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >>
> >
> >-- 
> >Brian D. Ripley,  rip...@stats.ox.ac.uk
> >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
> 

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


Re: [Rd] Question on trying to build R 2.11.1 on Tru64(aka OSF1) system

2010-06-08 Thread Prof Brian Ripley
Ah, so configure has chosen /bin/ksh as the shell, and that does not 
like this sh syntax on your system.  Try setting R_SHELL=/bin/sh when 
configuring (or the path to bash, if you have that).


Alternatively, use $...@} in Rcmd.in (we have that as a workaround in 
R.sh.in).


On Tue, 8 Jun 2010, bill.gless...@cwu.edu wrote:



Here is the Rcmd from the ./bin subdirectory of the build tree
/usrX/JunqueYard/R-2.11.1:

#!/bin/ksh
#
# ${R_HOME}/bin/Rcmd

## Shell script wrapper for all R CMD commands.
## For internal use only.

R_CMD="${R_HOME}/bin/Rcmd"
export R_CMD

R_VERSION=2.11.1
export R_VERSION

R_OSTYPE="unix"
export R_OSTYPE

## Add 'share/perl' to the perl library path.
if test -n "${PERL5LIB}"; then
 PERL5LIB="${R_SHARE_DIR}/perl:${PERL5LIB}"
 export PERL5LIB
else
 PERLLIB="${R_SHARE_DIR}/perl:${PERLLIB}"
 export PERLLIB
fi

## Append 'share/texmf' to TeX's input search path.
if test -z "$TEXINPUTS}"; then
 TEXINPUTS=".:${R_SHARE_DIR}/texmf:"
else
 TEXINPUTS=".:${TEXINPUTS}:${R_SHARE_DIR}/texmf:"
fi
export TEXINPUTS

. "${R_HOME}/etc${R_ARCH}/Renviron"
export `sed 's/^ *#.*//; s/^\(.*\)=.*/\1/' "${R_HOME}/etc${R_ARCH}/Renviron"`

extra=
case "${1}" in
 perl)
   cmd="${PERL}" ;;
 awk)
   cmd="${AWK}"  ;;
## this was a separate command prior to 2.10.0
 Rd2txt)
   cmd="${R_HOME}/bin/Rdconv"
   extra="-t txt"
   ;;
 Rd2pdf)
   cmd="${R_HOME}/bin/Rd2dvi"
   extra="--pdf"
   ;;
 *)
   if test -x "${R_HOME}/bin/${1}"; then
 cmd="${R_HOME}/bin/${1}"
   else
 cmd="${1}"
   fi
   ;;
esac
shift

exec "${cmd}" ${extra} "$...@}"

### Local Variables: ***
### mode: sh ***
### sh-indentation: 2 ***
### End: ***

Bill


Return-path: 
Date: Tue, 08 Jun 2010 19:41:05 +0100 (BST)
From: Prof Brian Ripley 
Subject: Re: [Rd] Question on trying to build R 2.11.1 on Tru64(aka OSF1) system
To: bill.gless...@cwu.edu
Cc: r-devel@r-project.org

On Tue, 8 Jun 2010, bill.gless...@cwu.edu wrote:



Hello,

I am trying to build the R-2.11.1 software for university faculty to use in
research projects on a DEC/Compaq/HP AlphaServer model GS160 16CPU/64GB memory
running Tru64Unix aka OSF1 version 5.1B-5.
Is it known whether it is possible to build the R-2.11.1 software on the
platform I am using?


It is not known: it is years since we have a report on that system.

You seem to have a problem with Rcmd, that is R_HOME/bin/Rcmd.
Perhaps you could send it to us to have a look at?


...snip...
__
R-devel@r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-devel




--
Brian D. Ripley,  rip...@stats.ox.ac.uk
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



--
Brian D. Ripley,  rip...@stats.ox.ac.uk
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] Question on trying to build R 2.11.1 on Tru64(aka OSF1) system

2010-06-08 Thread Peter Dalgaard
Prof Brian Ripley wrote:
> Ah, so configure has chosen /bin/ksh as the shell, and that does not 
> like this sh syntax on your system.  Try setting R_SHELL=/bin/sh when 
> configuring (or the path to bash, if you have that).
> 
> Alternatively, use $...@} in Rcmd.in (we have that as a workaround in 
> R.sh.in).
> 

We even do it using @OSF_SH_BUG@, which would probably be a good idea to
clone in Rcmd.in. On the other hand, the use of $...@} in Rcmd.in goes
back to at least 2002, which is a bit puzzling. Did OSF really not get
tested since then??

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Phone: (+45)38153501
Email: pd@cbs.dk  Priv: pda...@gmail.com

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


Re: [Rd] [R] textbox in lattice

2010-06-08 Thread Paul Murrell

Hi

On 6/6/2010 11:20 PM, baptiste auguie wrote:

Hi,

I've just added width/heightDetails methods following Paul's
suggestion. I kept a duplicate of all on-the-fly grob size
calculations; it is necessary to ensure that the table cells adjust to
the content which can be subsequently edited (e.g changing the
colnames to plotmath expressions). Drawing the full iris dataset (150
x 5) takes 12 seconds when it was 8 seconds before. It is still
reasonable; I don't think anyone would want to use it for huge tables
anyway.

Out of curiosity, could drawDetails and height/widthDetails be altered
to share some information (thereby avoiding such duplication of
calculations at drawing time), or do they have to be completely
independent in the implementation?


In theory, you could cache information from drawing (such as where on 
the device you drew), but this would have to be updated if the device is 
resized (or output is copied between devices) and there is no general 
infrastructure to support that at the moment.


PLUS width/height calculations can be performed independently of 
drawing.  I might want to position some output based on where a grob 
WOULD be drawn, but without actually drawing the grob.  So it would not 
be safe, for example, for widthDetails() to assume that drawDetails() 
had previously been called.


These are not insurmountable problems;  they are just examples to show 
that the implementation would be non-trivial.


Paul


Best,

baptiste

On 3 June 2010 07:58, baptiste auguie  wrote:

Hi,

On 3 June 2010 05:26, Paul Murrell  wrote:


Or the same drawing calculations have to be repeated within
width/heightDetails - those methods should get run within the same graphical
context as the drawDetails method.



Yes, the idea crossed my mind, but I did not find it very appealing
(already the function is slower than it could/should be). Something to
consider though, in a future version.

Thanks,

baptiste






Paul


Best,

baptiste

__
r-h...@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


--
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
p...@stat.auckland.ac.nz
http://www.stat.auckland.ac.nz/~paul/





--
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
p...@stat.auckland.ac.nz
http://www.stat.auckland.ac.nz/~paul/

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


Re: [Rd] Question on trying to build R 2.11.1 on Tru64(aka OSF1) system

2010-06-08 Thread Prof Brian Ripley

On Wed, 9 Jun 2010, Peter Dalgaard wrote:


Prof Brian Ripley wrote:

Ah, so configure has chosen /bin/ksh as the shell, and that does not
like this sh syntax on your system.  Try setting R_SHELL=/bin/sh when
configuring (or the path to bash, if you have that).

Alternatively, use $...@} in Rcmd.in (we have that as a workaround in
R.sh.in).


We even do it using @OSF_SH_BUG@, which would probably be a good idea to
clone in Rcmd.in.


Already done in R-devel.  But the argument is whether we should 
complicate R (and risk breaking currently working setups) or expect 
people with broken tools to replace them.  Certainly for AIX (where sh 
is zsh and this workaround does not work) it is necessary to set 
R_SHELL to bash.



On the other hand, the use of $...@} in Rcmd.in goes
back to at least 2002, which is a bit puzzling. Did OSF really not get
tested since then??


No: PR#9365 (which I fixed via @OSF_SH_BUG@) was in 2006 -- I think 
that was the last report and long after any other.



--
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Phone: (+45)38153501
Email: pd@cbs.dk  Priv: pda...@gmail.com



--
Brian D. Ripley,  rip...@stats.ox.ac.uk
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