Dan,

Thank you for your reply! Indeed, the message is consistent when using the
unstable version 2014-03-31 r65345. Even when using this version, though, I
observe the following inconsistency:

Adams-MacBook-Air:work adam$ R --vanilla

R Under development (unstable) (2014-03-31 r65345) -- "Unsuffered
Consequences"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin10.8.0 (64-bit)
...
...
Type 'q()' to quit R.

> x<-1:4; dim(x)<-c(2,2); x[[-2, 0]]
Error in x[[-2, 0]] : attempt to select less than one element
> x<-1:4; dim(x)<-c(2,2); x[[-2, 0]]
Error in x[[-2, 0]] : attempt to select more than one element
> x<-1:4; dim(x)<-c(2,2); x[[-2, 0]]
Error in x[[-2, 0]] : attempt to select less than one element
> x<-1:4; dim(x)<-c(2,2); x[[-2, 0]]
Error in x[[-2, 0]] : attempt to select less than one element
> x<-1:4; dim(x)<-c(2,2); x[[-2, 0]]
Error in x[[-2, 0]] : attempt to select more than one element
> x<-1:4; dim(x)<-c(2,2); x[[-2, 0]]
Error in x[[-2, 0]] : attempt to select less than one element
> x<-1:4; dim(x)<-c(2,2); x[[-2, 0]]
Error in x[[-2, 0]] : attempt to select less than one element


Any thoughts?

Thank you

Adam



On Wed, Apr 2, 2014 at 3:32 PM, Dan Tenenbaum <dtenenba@fhcrc.org> wrote:

>
>
> ----- Original Message -----
> > From: "Adam Welc" <adamwelc@yahoo.com>
> > To: r-devel@r-project.org
> > Sent: Wednesday, April 2, 2014 3:11:28 PM
> > Subject: [Rd] inconsistent error messages on Mac OS X
> >
> > Hi All,
> >
> > I am one of the contributors to the FastR project (
> > https://bitbucket.org/allr <https://bitbucket.org/allr.>) and I have
> > encountered an interesting issue when trying to implement vector
> > accesses
> > within FastR. I am trying to understand what kind of error message
> > should
> > be generated for the following expression:
> >
> > x<-1:4; x[[1]]<-NULL; x
> >
> > In order to determine the error message, I ran the shell of standard
> > GNU R
> > (installed via MacPorts - R version 2.15.3) on Mac OS X 10.8.5 as
> > follows,
> > with R metadata (that is .RData or .Rhistory files) removed from the
> > current directory
>
> Instead you should probably start R as follows:
>
> R --vanilla
>
> ?Startup explains why removing .RData etc from the current directory is
> not enough, in the absence of --vanilla.
>
> >(I have edited portions of the R header printed
> > when the
> > shell starts for the sake for readability):
> >
> > Adams-MacBook-Air:work adam$ R
> >
> > R version 2.15.3 (2013-03-01) -- "Security Blanket"
> > Copyright (C) 2013 The R Foundation for Statistical Computing
> > ISBN 3-900051-07-0
> > Platform: x86_64-apple-darwin12.3.0/x86_64 (64-bit)
> > ...
> > ...
> > Type 'q()' to quit R.
> >
> > > x<-1:4; x[[1]]<-NULL; x
> > Error in x[[1]] <- NULL :
> >   incompatible types (from NULL to integer) in [[ assignment
> > > q()
> > Save workspace image? [y/n/c]: n
> >
> >
> > Adams-MacBook-Air:work adam$ R
> >
> > R version 2.15.3 (2013-03-01) -- "Security Blanket"
> > Copyright (C) 2013 The R Foundation for Statistical Computing
> > ISBN 3-900051-07-0
> > Platform: x86_64-apple-darwin12.3.0/x86_64 (64-bit)
> > ...
> > ...
> > Type 'q()' to quit R.
> >
> > > x<-1:4; x[[1]]<-NULL; x
> > Error in x[[1]] <- NULL :
> >   more elements supplied than there are to replace
> > >
> >
> >
> > As you can see, the error message for the same expression is
> > different on
> > two subsequent executions of the GNU R shell (with no workspace image
> > saving - but it does not matter, as I observe the same behavior if
> > the
> > workspace is saved).
> >
> > I tried the same thing on Linux, but there the behavior seems
> > consistent
> > (the second message is displayed in each execution).
> >
> > This issue is not specific to this single expression - it happens in
> > other
> > (though not all) cases when the NULL value is assigned to an element
> > of a
> > vector.
> >
> > I was wondering if someone has observed the same behavior and perhaps
> > knows
> > what may be causing it...
> >
>
> I can't reproduce this on
> R Under development (unstable) (2013-10-12 r64048)
>
> with or without --vanilla, it consistently gives the second error message.
>
> Dan
>
>
> > Thank you
> >
> > Adam
> >
> >       [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >
>

	[[alternative HTML version deleted]]

