[Rd] parse():ing a unclosed string

2005-08-14 Thread Henrik Bengtsson
When parse():ing R code from *file* with a unclosed string, that is, a 
string that has an open quoation mark, but not a ending one, the string 
seems to be closed automagically.  Is this a "bug"?

Example:

 > code <- "x <- '123";
 > parse(text=code)   # Gives an error as expected
Error in parse(file, n, text, prompt) : parse error

 > cat(file="foo.R", code)
 > expr <- parse("foo.R") # Closes the open string
 > print(expr)
expression(x <- "123\n")

Parsing from stdin(), that is parse(), gives an error too.

Platform: Windows XP Pro SP2, R Version 2.1.1 Patched (2005-07-20) as 
well as R Version 2.2.0 Under development (unstable) (2005-07-19 r34991).

Best

Henrik Bengtsson

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


[Rd] make check-all fails (PR#8063)

2005-08-14 Thread jed
Full_Name: Jed Kaplan
Version: 2.1.1 Patched
OS: Fedora Core 4
Submission from: (NULL) (66.31.221.212)


Installation through "make check" succeeds. "Make check-all" fails with the
following tail message:
"
make[3]: Entering directory `/mnt/linuxApp/usr/local/R/R-patched/tests'
running code in 'p-r-random-tests.R' ...make[3]: *** [p-r-random-tests.Rout]
Error 1
make[3]: Leaving directory `/mnt/linuxApp/usr/local/R/R-patched/tests'
make[2]: *** [test-Random] Error 2
make[2]: Leaving directory `/mnt/linuxApp/usr/local/R/R-patched/tests'
make[1]: *** [test-all-devel] Error 1
make[1]: Leaving directory `/mnt/linuxApp/usr/local/R/R-patched/tests'
make: *** [check-all] Error 2
"

The tail of ./tests/p-r-random-tests.Rout.fail is:
"
> dkwtest("nbinom",size =   1,prob = 0.8)
nbinom(size = 1, prob = 0.8) PASSED
[1] TRUE
> dkwtest("nbinom",size = 100,prob = 0.8)
nbinom(size = 100, prob = 0.8) PASSED
[1] TRUE
> dkwtest("nbinom",size = 100,prob = 0.999)
nbinom(size = 100, prob = 0.999) PASSED
[1] TRUE
>
> dkwtest("norm")
norm() FAILED
Error in dkwtest("norm") : dkwtest failed
Execution halted
"

Here is some system configuration output from "./configure" :
"
R is now configured for i686-pc-linux-gnu

  Source directory:  .
  Installation directory:/usr/local

  C compiler:gcc  -g -O2
  C++ compiler:  g++  -g -O2
  Fortran compiler:  f95  -g -O2

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

  Recommended packages:  yes
"

Please advise.

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


[Rd] documentation for eval() typo

2005-08-14 Thread Paul Roebuck
>It is equivalent to 'evalq' except the its default
^^^

> R.version.string
[1] "R version 2.1.1, 2005-06-20"

--
SIGSIG -- signature too long (core dumped)

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


Re: [Rd] make check-all fails (PR#8063)

2005-08-14 Thread ripley
Please do read the docs: this test is randomm and will fail about 1 in 50 
and if you have already run make check, you have already passed it.

Definitely no bug in R.

On Sun, 14 Aug 2005 [EMAIL PROTECTED] wrote:

> Full_Name: Jed Kaplan
> Version: 2.1.1 Patched
> OS: Fedora Core 4
> Submission from: (NULL) (66.31.221.212)
>
>
> Installation through "make check" succeeds. "Make check-all" fails with the
> following tail message:
> "
> make[3]: Entering directory `/mnt/linuxApp/usr/local/R/R-patched/tests'
> running code in 'p-r-random-tests.R' ...make[3]: *** [p-r-random-tests.Rout]
> Error 1
> make[3]: Leaving directory `/mnt/linuxApp/usr/local/R/R-patched/tests'
> make[2]: *** [test-Random] Error 2
> make[2]: Leaving directory `/mnt/linuxApp/usr/local/R/R-patched/tests'
> make[1]: *** [test-all-devel] Error 1
> make[1]: Leaving directory `/mnt/linuxApp/usr/local/R/R-patched/tests'
> make: *** [check-all] Error 2
> "
>
> The tail of ./tests/p-r-random-tests.Rout.fail is:
> "
>> dkwtest("nbinom",size =   1,prob = 0.8)
> nbinom(size = 1, prob = 0.8) PASSED
> [1] TRUE
>> dkwtest("nbinom",size = 100,prob = 0.8)
> nbinom(size = 100, prob = 0.8) PASSED
> [1] TRUE
>> dkwtest("nbinom",size = 100,prob = 0.999)
> nbinom(size = 100, prob = 0.999) PASSED
> [1] TRUE
>>
>> dkwtest("norm")
> norm() FAILED
> Error in dkwtest("norm") : dkwtest failed
> Execution halted
> "
>
> Here is some system configuration output from "./configure" :
> "
> R is now configured for i686-pc-linux-gnu
>
>  Source directory:  .
>  Installation directory:/usr/local
>
>  C compiler:gcc  -g -O2
>  C++ compiler:  g++  -g -O2
>  Fortran compiler:  f95  -g -O2
>
>  Interfaces supported:  X11
>  External libraries:readline
>  Additional capabilities:   PNG, JPEG, iconv, MBCS, NLS
>  Options enabled:   R profiling
>
>  Recommended packages:  yes
> "
>
> Please advise.
>
> __
> 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


Re: [Rd] parse():ing a unclosed string

2005-08-14 Thread Prof Brian Ripley
On Sun, 14 Aug 2005, Henrik Bengtsson wrote:

> When parse():ing R code from *file* with a unclosed string, that is, a
> string that has an open quoation mark, but not a ending one, the string
> seems to be closed automagically.  Is this a "bug"?

It's clearly intentional from the comments in the sources: EOF during 
parsing is treated specially.

Generally the parser has not been written to find all syntactic errors: in 
any case one would need a formal language definition to do that.  Prior to 
R-devel quite a few mal-formed constants were accepted, for example.

> Example:
>
> > code <- "x <- '123";
> > parse(text=code)   # Gives an error as expected
> Error in parse(file, n, text, prompt) : parse error
>
> > cat(file="foo.R", code)

What exactly is in this file?

> > expr <- parse("foo.R") # Closes the open string
> > print(expr)
> expression(x <- "123\n")
>
> Parsing from stdin(), that is parse(), gives an error too.

Those are _not_ the same thing.  I am not clear what you actually tried, 
as you cannot generate an EOF this way.

> Platform: Windows XP Pro SP2, R Version 2.1.1 Patched (2005-07-20) as
> well as R Version 2.2.0 Under development (unstable) (2005-07-19 r34991).

These are rather old for non-released versions: there have been many 
changes since then (especially in 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


Re: [Rd] documentation for eval() typo

2005-08-14 Thread Prof Brian Ripley
Thank you.  It would be easier to deal with thes reports if in future you 
could provide a patch against the source file (here eval.Rd).

On Sun, 14 Aug 2005, Paul Roebuck wrote:

>> It is equivalent to 'evalq' except the its default

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