GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Data::Frame::Role::Rlike(3) User Contributed Perl Documentation Data::Frame::Role::Rlike(3)

Data::Frame::Role::Rlike

version 0.006004

Data::Frame::Role::Rlike - role to provide R-like methods for Data::Frame

    head( Int $n=6 )

If $n ≥ 0, returns a new "Data::Frame" with the first $n rows of the "Data::Frame".

If $n < 0, returns a new "Data::Frame" with all but the last -$n rows of the "Data::Frame".

See also: R's head <https://stat.ethz.ch/R-manual/R-devel/library/utils/html/head.html> function.

    tail( Int $n=6 )

If $n ≥ 0, returns a new "Data::Frame" with the last $n rows of the "Data::Frame".

If $n < 0, returns a new "Data::Frame" with all but the first -$n rows of the "Data::Frame".

See also: R's tail <https://stat.ethz.ch/R-manual/R-devel/library/utils/html/head.html> function.

    subset( CodeRef $select )

"subset" is a helper method used to take the result of a the $select coderef and use the return value as an argument to "Data::Frame#select_rows" in "select_rows">.

The argument $select is a CodeRef that is passed the Data::Frame
$select->( $df ); # $df->subset( $select ); and returns a PDL. Within the scope of the $select CodeRef, $_ is set to a "Data::Frame::Column::Helper" for the Data::Frame $df.

    use Data::Frame::Rlike;
    use PDL;
    my $N  = 5;
    my $df = dataframe( x => sequence($N), y => 3 * sequence($N) );
    say $df->subset( sub {
                           ( $_->('x') > 1 )
                         & ( $_->('y') < 10 ) });
    # ---------
    #     x  y
    # ---------
    #  2  2  6
    #  3  3  9
    # ---------

See also: R's subset <https://stat.ethz.ch/R-manual/R-devel/library/base/html/subset.html> function

  • Zakariyya Mughal <zmughal@cpan.org>
  • Stephan Loyd <sloyd@cpan.org>

This software is copyright (c) 2014, 2019-2022 by Zakariyya Mughal, Stephan Loyd.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2024-12-20 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.