NAME

Data::Frame::Util - Utility functions

VERSION

version 0.0042_02

DESCRIPTION

This module provides some utility functions used by the Data::Frame project.

FUNCTIONS

dataframe

my $df = dataframe(...); 

Creates a Data::Frame object.

factor

my $logical = factor(...); 

Creates a PDL::Factor object.

logical

my $logical = logical(...); 

Creates a PDL::Logical object.

BAD

my $bad = BAD($n);

A convenient function for generating all-BAD piddles of the given length.

NA

This is an alias of the BAD function.

ifelse

my $rslt_piddle = ifelse($test, $yes, $no)

This function tries to do the same as R's ifelse function. That is, it returns a piddle of the same length as $test, and is filled with elements selected from $yes or $no depending on whether the corresponding element in $test is true or false.

$test, $yes, $no should ideally be piddles or cocere-able to piddles.

is_discrete

my $bool = is_discrete(ColumnLike $x);

Returns true if $x is discrete, that is, an object of below types,

  • PDL::Factor

  • PDL::SV

guess_and_convert_to_pdl

AUTHORS

  • Zakariyya Mughal <zmughal@cpan.org>

  • Stephan Loyd <sloyd@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014, 2019 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.