From pdalgd at gmail.com  Fri Mar  4 09:21:48 2016
From: pdalgd at gmail.com (peter dalgaard)
Date: Fri, 4 Mar 2016 09:21:48 +0100
Subject: [Rd] as.vector in R-devel loaded 3/3/2016
In-Reply-To: <CA+_rFBJbtEw47Qq-yfs54E7AwgX8+HK3FcXL3a7z+coDA=-KeQ@mail.gmail.com>
References: <CA+_rFBK8c5gXFm41StNPDiBYTW=uLXvj5d4cGzpfi9gdv-mW7A@mail.gmail.com>
	<CA+_rFBJbtEw47Qq-yfs54E7AwgX8+HK3FcXL3a7z+coDA=-KeQ@mail.gmail.com>
Message-ID: <CB88A7FF-6C3D-400A-A086-6C6E5E75B507@gmail.com>

Er, until _what_ is fixed?

I see no anomalies with the version in R-pre:

> library(Matrix)
> as.vector
standardGeneric for "as.vector" defined from package "base"

function (x, mode = "any") 
standardGeneric("as.vector")
<environment: 0x7fe8f4516640>
Methods may be defined for arguments: x, mode
Use  showMethods("as.vector")  for currently available ones.
> str(as.vector(1:3))
 int [1:3] 1 2 3
> str(as.vector(1:3+0))
 num [1:3] 1 2 3
> str(as.vector(list(1,2,3))
+ )
List of 3
 $ : num 1
 $ : num 2
 $ : num 3
> str(as.vector(list(1,2,3), mode="integer"))
 int [1:3] 1 2 3
> str(as.vector(list(1,2,3), mode="numeric"))
 num [1:3] 1 2 3


Also, *current* r-devel has the same definition:

$ ~/r-devel/BUILD-dist/bin/R

R Under development (unstable) (2016-03-03 r70270) -- "Unsuffered Consequences"
[...yadayada...]
> library(Matrix)
> as.vector
function (x, mode = "any") 
.Internal(as.vector(x, mode))
<bytecode: 0x7fdf69279780>
<environment: namespace:base>


> On 04 Mar 2016, at 01:09 , Jeff Laake - NOAA Federal <jeff.laake at noaa.gov> wrote:
> 
> I dug into this a little further and discovered the problem.  When my
> package is for checking, it loads Matrix.  In the R-devel version of
> Matrix, as.vector is re-defined without mode specified
> 
>> as.vector
> standardGeneric for "as.vector" defined from package "base"
> 
> function (x, mode)
> standardGeneric("as.vector")
> <environment: 0x082faf08>
> Methods may be defined for arguments: x, mode
> Use  showMethods("as.vector")  for currently available ones.
> 
> In R3.2.3 it is defined with mode="any" specified.
> 
>> as.vector
> standardGeneric for "as.vector" defined from package "base"
> 
> function (x, mode = "any")
> standardGeneric("as.vector")
> <environment: 0x084af110>
> Methods may be defined for arguments: x, mode
> Use  showMethods("as.vector")  for currently available ones.
> 
> Until this is fixed I'll copy over the devel version of Matrix.
> 
> --jeff
> 
> 
> On Thu, Mar 3, 2016 at 7:23 AM, Jeff Laake - NOAA Federal <
> jeff.laake at noaa.gov> wrote:
> 
>> I just installed R-devel to check my package before submitting.  I got an
>> error in my vignette in regards to as.vector.  When I looked at the code
>> for as.vector in R-devel it is
>> 
>> standardGeneric for "as.vector" defined from package "base"
>> 
>> function (x, mode)
>> standardGeneric("as.vector")
>> <environment: 0x0918ad70>
>> Methods may be defined for arguments: x, mode
>> Use  showMethods("as.vector")  for currently available ones.
>> 
>> The code from R3.2.3 is
>>> as.vector
>> function (x, mode = "any")
>> .Internal(as.vector(x, mode))
>> <bytecode: 0x02dfb858>
>> <environment: namespace:base>
>>> 
>> 
>> Is default for mode missing as I suspect or will mode be required from now
>> on?
>> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



[Rd] as.vector in R-devel loaded 3/3/2016
peter dalgaard