Re: [Rd] Roxygen

2008-03-20 Thread Manuel . Eugster
>> It is desirable that these tags and their syntax and semantics be
>> compatible with those used by Doxygen and Javadoc, but extended with
>> tags important for R specific things.
>
> Doxygen, in particular, has some tags that are meaningless in R
> (@category and @protocol come to mind); wouldn't it be worthwhile,
> therefore, to start with a subset of Rd?
>
> Thinks like @name and @format could be gleaned from the code; and it
> seems like preserving other Rd names would uphold the "principle of
> least surprise."
>

Yes, actually I did not meant that you have to take the union of Javadoc
and Doxygen keywords and try to fit it into R. Start with the things
from R documentation, extend it with usefull R-specific keywords (like
@export). And keep in mind that there may be users which use Doxygen
and Javadoc and we want to uphold the "principle of least surprise". :-)


Manuel.

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


Re: [Rd] Problems building rpm for R-2.6.2 on Opensuse Factory

2008-03-20 Thread Detlef Steuer
On Tue, 18 Mar 2008 10:30:07 + (GMT)
Prof Brian Ripley <[EMAIL PROTECTED]> wrote:

> This is proving elusive.  The same build that gave incorrect results last 
> week gave correct results last night (and F8 has had about 50 updates 
> since, including two kernel updates).
> 
> I'd still suggest trying lower levels of optimization, as that was 
> definitely needed with some pre-releases of gcc 4.3.x.

For the record:
CFLAGS="-O" did it this time.

detlef

> 
> 
> On Mon, 17 Mar 2008, Prof Brian Ripley wrote:
> 
> > On Mon, 17 Mar 2008, Detlef Steuer wrote:
> >
> >> Hi,
> >> 
> >> make check fails in the way shown below when I try to build
> >> R-2.6.2 on OpenSuSE Factory x86_64. It builds fine on i586.
> >> (and on all older Versions of Opensuse)
> >> 
> >> Is there something I can do?
> >> Are there known problems with some gcc versions?
> >> (Factory uses 4.3.0)
> >
> > Yes.  This happened for me with (vanilla released) gcc 4.3.0 on F8 x86_64 
> > too.  Turning optimization off for both C and Fortran solved it -- I've not 
> > yet had time to track down what you need not to optimize.  I'll try to do 
> > that this evening.
> >
> > As I understand it, CRAN is successfully building R with a Debian x86_64 
> > build of gcc 4.3.0, but several packages are failing in that configuration.
> >
> >> 
> >> Output from ./configure is
> >> -
> >> R is now configured for x86_64-unknown-linux-gnu
> >> 
> >> Source directory: .
> >> Installation directory: /usr
> >> 
> >> C compiler: gcc -std=gnu99 -g -O2
> >> Fortran 77 compiler: gfortran -g -O2
> >> 
> >> C++ compiler: g++ -g -O2
> >> Fortran 90/95 compiler: gfortran -g -O2
> >> Obj-C compiler:
> >> 
> >> Interfaces supported: X11, tcltk
> >> External libraries: readline
> >> Additional capabilities: PNG, JPEG, iconv, MBCS, NLS
> >> Options enabled: shared R library, shared BLAS, R profiling
> >> 
> >> Recommended packages: yes
> >> -
> >> 
> >> It may very well be an error on the Opensuse side, but I'm  just not
> >> sure how to identify the true cause of the problem.
> >> Any help appreciated.
> >> 
> >> Detlef
> >> 
> >> -
> >> Error message:
> >> 
> >> running code in 'lapack.R' ... OK
> >> comparing 'lapack.Rout' to './lapack.Rout.save' ... OK
> >> make[3]: Leaving directory `/usr/src/packages/BUILD/R-2.6.2/tests'
> >> make[2]: Leaving directory `/usr/src/packages/BUILD/R-2.6.2/tests'
> >> make[2]: Entering directory `/usr/src/packages/BUILD/R-2.6.2/tests'
> >> running regression tests
> >> make[3]: Entering directory `/usr/src/packages/BUILD/R-2.6.2/tests'
> >> running code in 'reg-tests-1.R' ... OK
> >> running code in 'reg-tests-2.R' ... OK
> >> comparing 'reg-tests-2.Rout' to './reg-tests-2.Rout.save' ...1318c1318
> >> < 0.1230 -0.7187
> >> ---
> >>> 0.1230 0.3170
> >> 1328c1328
> >> < 0.1230 -0.7187
> >> ---
> >>> 0.1230 0.3170
> >> 1356c1356
> >> < -0.2364 -0.3594
> >> ---
> >>> 0.2814 0.1585
> >> 1366c1366
> >> < 0.62010 -0.55327 -0.15379 0.02127
> >> ---
> >>> 0.49064 -0.68273 -0.02433 0.15074
> >> 1375c1375
> >> < 1.17337 0.06683 -0.15379 0.02127
> >> ---
> >>> 1.17337 -0.19209 -0.02433 0.15074
> >> make[3]: *** [reg-tests-2.Rout] Error 1
> >> make[3]: Leaving directory `/usr/src/packages/BUILD/R-2.6.2/tests'
> >> make[2]: *** [test-Reg] Error 2
> >> make[2]: Leaving directory `/usr/src/packages/BUILD/R-2.6.2/tests'
> >> make[1]: *** [test-all-basics] Error 1
> >> make[1]: Leaving directory `/usr/src/packages/BUILD/R-2.6.2/tests'
> >> make: *** [check] Error 2
> >> error: Bad exit status from /var/tmp/rpm-tmp.74662 (%build)
> >> 
> >> __
> >> R-devel@r-project.org mailing list
> >> https://stat.ethz.ch/mailman/listinfo/r-devel
> >> 
> >
> > -- 
> > 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
> >
> 
> -- 
> 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] R_ParseVector problem: it's cutting off after the decimal point

2008-03-20 Thread Roland Boubela
Dear all,

my aim is to integrate R in an interactive visualisation software
called Bulk Analyzer developed by VrVis (http://www.vrvis.at).

the code:

SEXP e, tmp;
ParseStatus status;

PROTECT(tmp = mkString("x <- c(1.234,-3.45)"));
PrintValue(tmp);
PROTECT(e = R_ParseVector(tmp, -1, &status, R_NilValue));
PrintValue(e);
UNPROTECT(2);

produces the following output:

[1] "x <- c(1.234,-3.45)"

expression(x <- c(1, -3))


I'm using MS Visual C++. The code works fine in a small test project
with the same R startup settings (attached) as in the Bulk Analyzer
project.
Is there any setting or condition for this parser behaviour?

Kind regards,
Roland N. Boubela


> sessionInfo()
R version 2.6.2 (2008-02-08)
i386-pc-mingw32

locale:
German_Austria.1252

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

// init R
Rf_initEmbeddedR(0, NULL);

Rstart Rp = &rp;
R_DefParams(Rp);

// root of the R installation
Rp->rhome = get_R_HOME();

// root of the users directory
Rp->home = getRUser();

// UImode: RGui, RTerm, LinkDLL
Rp->CharacterMode = LinkDLL;

// function which reads input for R from a console
Rp->ReadConsole = myReadConsole;

// function which writes output from R to a console
Rp->WriteConsole = NULL;
Rp->WriteConsoleEx = myWriteConsoleEx;

// called during i/o, eval, graphics in ProcessEvents
Rp->CallBack = myCallBack;

// handles messages for the user from R
Rp->ShowMessage = myShowconcise Message;

// user interaction: a user is asked a question an should answer
with YesNoCancel (maybe dialog)
Rp->YesNoCancel = myYesNoCancel;

// on R state changed: busy(=1)/idle(=0)
Rp->Busy = myBusy;

Rp->home = getRUser();

// R-Settings...
Rp->R_Quiet= (Rboolean)FALSE;
Rp->R_Interactive= (Rboolean)TRUE;
Rp->RestoreAction= SA_RESTORE;
Rp->SaveAction= SA_NOSAVE;

// our parameters
R_SetParams(Rp);
R_set_command_line_arguments(0, NULL);

GA_initapp(0, NULL);
readconsolecfg();

/// run_Rmainloop() starting in a different thread

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


[Rd] code optimization,analysis

2008-03-20 Thread m jacobson
Hi,

After having used S+ in commercial setting and then R
in non-commerical (but still supporting my commercial
interests), I would like to give back, if possible.

Where I can contribute:
1.  SCAN / PREVENT Stability and Threat analysis (big
open source presence supported by coverity)
2.  Intel Threaded Building Blocks library support to
leverage multicore CPUs (plan now for 8-way)
3.  VTune analysis/cache optimization for
identification of loop unrolls, etc.

All this would be on linux (Fed8 at present), except I
do have an Intel compiler on Win if it was needed,
would need to find fortran compiler, make lots of
adjustments, I suspect.
 
I've already started on #3 and would only take on #1
if someone in the R project blessed, because David
Miller at coverity likes to support the broader
projects over lone-cowboy stuff.

P.S. What an easy build, as far as open src goes, your
build person deserves credit.  I'm currently setting
up to compare gcc to intel compiler on the R base and
rerunning the timing benchmarks.

  Thanks.

M Jacobson
http://www.ihaveyoga.com
ph. 415.515.



  

Be a better friend, newshound, and

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


Re: [Rd] cut.Date and cut.POSIXt problem

2008-03-20 Thread Marc Schwartz

Hi all,

Apologies for the delay in my engaging in this thread. I was traveling 
this week.


The problem that Gabor raised was caused by the patch that I submitted 
to fix a problem with the referenced functions when using 'months' and 
'years' as the interval. The prior versions were problematic:


  https://stat.ethz.ch/pipermail/r-devel/2008-January/048004.html

The patch fixed the error, but since I used hist.Date() as the reference 
model and did not note the subtle difference in cut.Date() relative to 
specifying the breaks increment value, this functionality was lost when 
the same modification was made to the code in cut.Date().


Roger's patch helps, but does not totally remedy the situation. One also 
needs to modify the method used for specifying the max value 'end' for 
the breaks in order to include the max 'x' Date value in the result.


Hence, I am attaching proposed patches against R-devel for 
base:::dates.R and base:::datetime.R.


I am also attaching a patch for tests:::reg-tests-1.R to add a check for 
this situation to the regression tests that were also added subsequent 
to that prior set of patches that I had submitted.


If perhaps Roger and Gabor could so some testing on these patches before 
they are considered for inclusion into the R-devel tree, it would be 
helpful to check to see if I have missed something else here.


Thanks for raising this issue.

Regards,

Marc Schwartz

Roger D. Peng wrote:
Seems changes in r44116 force the interval to be single months (or 
years) instead of whatever the user specified.  I think the attached 
patches correct this.


Interestingly, 'cut' and 'seq' allow for the 'breaks' specification to 
be something like "3 months" but the documentation for 'hist' does not 
allow for this type of specification.


-roger

Gabor Grothendieck wrote:

cut.Date and cut.POSIXt indicate that the breaks argument
can be an integer followed by a space followed by "year", etc.
but it seems the integer is ignored.

For example, I assume that breaks = "3 months" is supposed
to cut it into quarters but, in fact, it cuts it into months as if
3 had not been there.


d <- seq(Sys.Date(), length = 12, by = "month")
cut(d, "3 months")

 [1] 2008-03-01 2008-04-01 2008-05-01 2008-06-01 2008-07-01 2008-08-01
2008-09-01 2008-10-01 2008-11-01 2008-12-01 2009-01-01 2009-02-01
Levels: 2008-03-01 2008-04-01 2008-05-01 2008-06-01 2008-07-01
2008-08-01 2008-09-01 2008-10-01 2008-11-01 2008-12-01 2009-01-01
2009-02-01

cut(as.POSIXct(d), "3 months")

 [1] 2008-03-01 2008-04-01 2008-05-01 2008-06-01 2008-07-01 2008-08-01
2008-09-01 2008-10-01 2008-11-01 2008-12-01 2009-01-01 2009-02-01
Levels: 2008-03-01 2008-04-01 2008-05-01 2008-06-01 2008-07-01
2008-08-01 2008-09-01 2008-10-01 2008-11-01 2008-12-01 2009-01-01
2009-02-01

cut(as.POSIXlt(d), "3 months")

 [1] 2008-03-01 2008-04-01 2008-05-01 2008-06-01 2008-07-01 2008-08-01
2008-09-01 2008-10-01 2008-11-01 2008-12-01 2009-01-01 2009-02-01
Levels: 2008-03-01 2008-04-01 2008-05-01 2008-06-01 2008-07-01
2008-08-01 2008-09-01 2008-10-01 2008-11-01 2008-12-01 2009-01-01
2009-02-01

--- datesORIG.R	2008-03-20 14:25:13.0 -0500
+++ dates.R	2008-03-20 14:38:21.0 -0500
@@ -322,17 +322,19 @@
 	if(valid == 3) {
 start$mday <- 1
 end <- as.POSIXlt(max(x, na.rm = TRUE))
-end <- as.POSIXlt(end + (31 * 86400))
+step <- ifelse(length(by2) == 2, as.integer(by2[1]), 1)
+end <- as.POSIXlt(end + (31 * step * 86400))
 end$mday <- 1
-breaks <- as.Date(seq(start, end, "months"))
+breaks <- as.Date(seq(start, end, breaks))
 } else if(valid == 4) {
 start$mon <- 0
 start$mday <- 1
 end <- as.POSIXlt(max(x, na.rm = TRUE))
-end <- as.POSIXlt(end + (366 * 86400))
+step <- ifelse(length(by2) == 2, as.integer(by2[1]), 1)
+end <- as.POSIXlt(end + (366 * step * 86400))
 end$mon <- 0
 end$mday <- 1
-breaks <- as.Date(seq(start, end, "years"))
+breaks <- as.Date(seq(start, end, breaks))
 } else {
 start <- .Internal(POSIXlt2Date(start))
 if (length(by2) == 2) incr <- incr * as.integer(by2[1])
--- datetimeORIG.R	2008-03-20 14:25:20.0 -0500
+++ datetime.R	2008-03-20 15:25:49.0 -0500
@@ -727,17 +727,19 @@
 	if(valid == 6) {
 start$mday <- 1
 end <- as.POSIXlt(max(x, na.rm = TRUE))
-end <- as.POSIXlt(end + (31 * 86400))
+step <- ifelse(length(by2) == 2, as.integer(by2[1]), 1)
+end <- as.POSIXlt(end + (31 * step * 86400))
 end$mday <- 1
-breaks <- seq(start, end, "months")
+breaks <- seq(start, end, breaks)
 } else if(valid == 7) {
 start$mon <- 0
 start$mday <- 1
 end <- as.POSIXlt(max(x, na.rm = TRUE))
-end <- as.POSIXlt(end + (366 * 86400))
+step <- ifelse(length(by2) == 2, as.integer(by2[1]), 1)
+end <- as.POSIXlt(end + (366 * step* 86400))
 end$mon 

Re: [Rd] R_ParseVector problem: it's cutting off after the decimal point

2008-03-20 Thread Prof Brian Ripley
There are so many things that might be going on here that I at least can't 
do more than guess pretty blindly.

First, you are assuming that this is a parser issue, but that's not proved 
by your test -- it might be a printing issue, which potentially involves 
deparsing. So I would have at least evaluated the expression and printed 
the result (via printf, not PrintValue).

I noticed that you did not check the parse status so we don't know if this 
parsed completely.

This could well be a locale issue: we don't have a complete program and 
you are in a non-English locale.  The setting of the locale category 
LC_NUMERIC does affect this, and I would not expect embedded R to work 
unless that was 'C'.

Here's a test that points to the locale issue:

> Sys.setlocale("LC_NUMERIC", "german")
[1] "German_Germany.1252"
Warning message:
In Sys.setlocale("LC_NUMERIC", "german") :
   setting 'LC_NUMERIC' may cause R to function strangely
> foo <- parse(text="x <- c(1.234,-3.45)")
> attributes(foo) <- NULL
> foo
expression(x <- c(1, -3))

So my guess it is an error in the environment you are using for embedded 
R.


On Wed, 19 Mar 2008, Roland Boubela wrote:

> Dear all,
>
> my aim is to integrate R in an interactive visualisation software
> called Bulk Analyzer developed by VrVis (http://www.vrvis.at).
>
> the code:
>
> SEXP e, tmp;
> ParseStatus status;
>
> PROTECT(tmp = mkString("x <- c(1.234,-3.45)"));
> PrintValue(tmp);
> PROTECT(e = R_ParseVector(tmp, -1, &status, R_NilValue));
> PrintValue(e);
> UNPROTECT(2);
>
> produces the following output:
>
> [1] "x <- c(1.234,-3.45)"
>
> expression(x <- c(1, -3))
>
>
> I'm using MS Visual C++. The code works fine in a small test project
> with the same R startup settings (attached) as in the Bulk Analyzer
> project.
> Is there any setting or condition for this parser behaviour?
>
> Kind regards,
> Roland N. Boubela
>
>
>> sessionInfo()
> R version 2.6.2 (2008-02-08)
> i386-pc-mingw32
>
> locale:
> German_Austria.1252
>
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods   base
> 
>// init R
>Rf_initEmbeddedR(0, NULL);
>
>Rstart Rp = &rp;
>R_DefParams(Rp);
>
>// root of the R installation
>Rp->rhome = get_R_HOME();
>
>// root of the users directory
>Rp->home = getRUser();
>
>// UImode: RGui, RTerm, LinkDLL
>Rp->CharacterMode = LinkDLL;
>
>// function which reads input for R from a console
>Rp->ReadConsole = myReadConsole;
>
>// function which writes output from R to a console
>Rp->WriteConsole = NULL;
>Rp->WriteConsoleEx = myWriteConsoleEx;
>
>// called during i/o, eval, graphics in ProcessEvents
>Rp->CallBack = myCallBack;
>
>// handles messages for the user from R
>Rp->ShowMessage = myShowconcise Message;
>
>// user interaction: a user is asked a question an should answer
> with YesNoCancel (maybe dialog)
>Rp->YesNoCancel = myYesNoCancel;
>
>// on R state changed: busy(=1)/idle(=0)
>Rp->Busy = myBusy;
>
>Rp->home = getRUser();
>
>// R-Settings...
>Rp->R_Quiet= (Rboolean)FALSE;
>Rp->R_Interactive= (Rboolean)TRUE;
>Rp->RestoreAction= SA_RESTORE;
>Rp->SaveAction= SA_NOSAVE;
>
>// our parameters
>R_SetParams(Rp);
>R_set_command_line_arguments(0, NULL);
>
>GA_initapp(0, NULL);
>readconsolecfg();
>
>/// run_Rmainloop() starting in a different thread
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
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] Installation error message with 2.6.2-win32 (PR#11007)

2008-03-20 Thread kzembowe
Full_Name: Kevin Zembower
Version: 2.6.2
OS: Windows XP Pro, ver 2002 SP2
Submission from: (NULL) (162.129.44.50)


Noticed the following errors and artifacts when trying to install R
2.6.2-win32.exe on my Windows XP Pro version 2002 Service Pack 2 workstation. I
first attempted to install it as the 'Administrator'. More than once, I got the
message, "Internal Error: Fialed to expand shell folder constant 'userdocs'".
Note that this is a networked PC at my work. I am not certain that the
Administrator has a home directory or that it is accessible. I noticed that
there was no entry for R itself in the Start->Programs->R folder, just ones for
Help and Uninstall.

Next, I tried installing the same file as a normal user on my system. I turned
off all registry entries, as I thought this was the problem the normal user
failed to install R the last time I tried this. This time, I got the error
"Setup was unable to create the directory "Y:\Start Menu\Programs\R" Error 5:
Access is denied." However, it did create Quick Launch and Desktop icons, that
seem to work correctly. R 2.6.2 seems to run correctly. As the error message
indicates, however, there is still no R entry itself in Start->Programs->R.

Please let me know if I can provide more information.

-Kevin Zembower

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


Re: [Rd] code optimization,analysis

2008-03-20 Thread Duncan Murdoch
On 20/03/2008 7:03 AM, m jacobson wrote:
> Hi,
> 
> After having used S+ in commercial setting and then R
> in non-commerical (but still supporting my commercial
> interests), I would like to give back, if possible.
> 
> Where I can contribute:
> 1.  SCAN / PREVENT Stability and Threat analysis (big
> open source presence supported by coverity)
> 2.  Intel Threaded Building Blocks library support to
> leverage multicore CPUs (plan now for 8-way)
> 3.  VTune analysis/cache optimization for
> identification of loop unrolls, etc.
> 
> All this would be on linux (Fed8 at present), except I
> do have an Intel compiler on Win if it was needed,
> would need to find fortran compiler, make lots of
> adjustments, I suspect.
>  
> I've already started on #3 and would only take on #1
> if someone in the R project blessed, because David
> Miller at coverity likes to support the broader
> projects over lone-cowboy stuff.

You didn't mention this, but putting together (and maintaining) a tool 
chain for 64 bit Windows builds would be appreciated.

> P.S. What an easy build, as far as open src goes, your
> build person deserves credit.  I'm currently setting
> up to compare gcc to intel compiler on the R base and
> rerunning the timing benchmarks.

That's largely due to Brian Ripley's efforts, but there are many other 
contributors to it.

Duncan Murdoch

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


Re: [Rd] Roxygen

2008-03-20 Thread Peter Danenberg
> No, we want a solution in R.

Would it suffice, by the way, to source() a file and introspect upon
its objects with ls(), formals(), typeof(), mode(), and the like; or
should we formalize, say, a BNF and write the accompanying automaton?

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