|
NAMEData::Frame::Role::Rlike VERSIONversion 0.006004 SYNOPSISData::Frame::Role::Rlike - role to provide R-like methods for Data::Frame METHODSheadhead( 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. tailtail( 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. subsetsubset( 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
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 AUTHORS
COPYRIGHT AND LICENSEThis 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.
|