Extract.data.frame.Rd about $.data.frame

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Extract.data.frame.Rd about $.data.frame

R devel mailing list
In R devel, data.frame method of '$' has been removed, but this part of "Details" section of Extract.data.frame.Rd still implies existence of the method.

  The \code{data.frame} method for \code{$}, treats \code{x} as a
  list, except that (as of R-3.1.0) partial matching of \code{name} to
  the names of \code{x} will generate a warning; this may become an
  error in future versions.  The replacement method checks
  \code{value} for the correct number of rows, and replicates it if
  necessary.


Statement from before R 3.1.0 could be used again:

  There is no \code{data.frame} method for \code{$}, so \code{x$name}
  uses the default method which treats \code{x} as a list.  There is a
  replacement method which checks \code{value} for the correct number
  of rows, and replicates it if necessary.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Extract.data.frame.Rd about $.data.frame

Martin Maechler
>>>>> Suharto Anggono Suharto Anggono via R-devel
>>>>>     on Sun, 10 Feb 2019 16:33:25 +0000 writes:

    > In R devel, data.frame method of '$' has been removed, but this part of "Details" section of Extract.data.frame.Rd still implies existence of the method.
    > The \code{data.frame} method for \code{$}, treats \code{x} as a
    > list, except that (as of R-3.1.0) partial matching of \code{name} to
    > the names of \code{x} will generate a warning; this may become an
    > error in future versions.  The replacement method checks
    > \code{value} for the correct number of rows, and replicates it if
    > necessary.


    > Statement from before R 3.1.0 could be used again:

    > There is no \code{data.frame} method for \code{$}, so \code{x$name}
    > uses the default method which treats \code{x} as a list.  There is a
    > replacement method which checks \code{value} for the correct number
    > of rows, and replicates it if necessary.

Thanks a lot, Suharto, for finding and reporting this!
I've added a 2 x 2 words of explanation to make it easier to understand.

Now changed.
Martin

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Extract.data.frame.Rd about $.data.frame

R devel mailing list
In reply to this post by R devel mailing list
The statement in R devel:
  There is no \code{data.frame} method for \code{$}, so \code{x$name}
  uses the default method which treats \code{x} as a list (with no partial
  matching of column names).  The replacement method (for \code{$}) checks
  \code{value} for the correct number of rows, and replicates it if necessary.

The added "(with no partial matching of column names)" is wrong. The default method of '$' (for extraction) allows partial matching for list; partial matching gives warning if option warnPartialMatchDollar is TRUE.

--------------------------------------------
On Fri, 15/2/19, Martin Maechler <[hidden email]> wrote:

 Subject: Re: [Rd] Extract.data.frame.Rd about $.data.frame

 Cc: [hidden email]
 Date: Friday, 15 February, 2019, 4:15 PM
 
>>>>> Suharto Anggono Suharto Anggono via R-devel

>>>>>    on Sun, 10 Feb 2019 16:33:25 +0000 writes:

    > In R devel, data.frame method of '$' has been removed, but this part of "Details" section of Extract.data.frame.Rd still implies existence of the method.
    > The \code{data.frame} method for \code{$}, treats \code{x} as a
    > list, except that (as of R-3.1.0) partial matching of \code{name} to
    > the names of \code{x} will generate a warning; this may become an
    > error in future versions.  The replacement method checks
    > \code{value} for the correct number of rows, and replicates it if
    > necessary.


    > Statement from before R 3.1.0 could be used again:

    > There is no \code{data.frame} method for \code{$}, so \code{x$name}
    > uses the default method which treats \code{x} as a list.  There is a
    > replacement method which checks \code{value} for the correct number
    > of rows, and replicates it if necessary.


[[elided Yahoo spam]]
I've added a 2 x 2 words of explanation to make it easier to understand.

Now changed.
Martin

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Extract.data.frame.Rd about $.data.frame

Martin Maechler
>>>>> Suharto Anggono Suharto Anggono via R-devel
>>>>>     on Mon, 18 Feb 2019 16:37:01 +0000 writes:

    > The statement in R devel: There is no \code{data.frame}
    > method for \code{$}, so \code{x$name} uses the default
    > method which treats \code{x} as a list (with no partial
    > matching of column names).  The replacement method (for
    > \code{$}) checks \code{value} for the correct number of
    > rows, and replicates it if necessary.

    > The added "(with no partial matching of column names)" is
    > wrong. The default method of '$' (for extraction) allows
    > partial matching for list; partial matching gives warning
    > if option warnPartialMatchDollar is TRUE.

Yes, thank you!
Indeed, of course it *is* matched when it can be matched uniquely;
otherwise it's silently not matched, returning NULL;
all as it has always been and well documented in ?Extract.

Martin

    > --------------------------------------------
    > On Fri, 15/2/19, Martin Maechler
    > <[hidden email]> wrote:

    >  Subject: Re: [Rd] Extract.data.frame.Rd about
    > $.data.frame

    >  Cc: [hidden email] Date: Friday, 15 February,
    > 2019, 4:15 PM
 
>>>>> Suharto Anggono Suharto Anggono via R-devel

>>>>>    on Sun, 10 Feb 2019 16:33:25 +0000 writes:

    >> In R devel, data.frame method of '$' has been removed,
    >> but this part of "Details" section of
    >> Extract.data.frame.Rd still implies existence of the
    >> method.  The \code{data.frame} method for \code{$},
    >> treats \code{x} as a list, except that (as of R-3.1.0)
    >> partial matching of \code{name} to the names of \code{x}
    >> will generate a warning; this may become an error in
    >> future versions.  The replacement method checks
    >> \code{value} for the correct number of rows, and
    >> replicates it if necessary.


    >> Statement from before R 3.1.0 could be used again:

    >> There is no \code{data.frame} method for \code{$}, so
    >> \code{x$name} uses the default method which treats
    >> \code{x} as a list.  There is a replacement method which
    >> checks \code{value} for the correct number of rows, and
    >> replicates it if necessary.


    > [[elided Yahoo spam]] I've added a 2 x 2 words of
    > explanation to make it easier to understand.

    > Now changed.  Martin

    > ______________________________________________
    > [hidden email] mailing list
    > https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel