Statis...P::List(3pm)
π Statistics::R::REXP::List β the Perl manual page, but make it cute π
okay bestie, this is the manual page for Statistics::R::REXP::List from the User Contributed Perl Documentation, and we're gonna get through it together. grab a snack. π
β¨ NAME β¨
Statistics::R::REXP::List β it's an R generic vector (a list), fr fr π¦
πΈ VERSION πΈ
version 1.0002 β that's the one, periodt.
π SYNOPSIS π
here's the vibe, copy-paste ready:
use Statistics::R::REXP::List
my $vec = Statistics::R::REXP::List->new([
1, '', 'foo', ['x', 22]
]);
print $vec->elements;
π DESCRIPTION π
so like, an object of this class represents an R list β which is also called a generic vector, aka VECSXP, iykyk. and here's the iconic part: list elements can themselves be lists, so you can build a whole tree structure out of these. nesting is the moment. π
π METHODS π
Statistics::R::REXP:List inherits from Statistics::R::REXP::Vector, and it adds no extra restrictions on what its elements can be. freedom, honestly.
missing values (NA in R) have the value undef. no cap. π
β sexptype
the SEXPTYPE of generic vectors is VECSXP. that's it, that's the whole thing.
π to_pl
the Perl value of the list is an array reference pointing at the Perl values of its elements β but (and this is the spicy bit) it uses a plain scalar value to represent elements that are atomic vectors of length 1, instead of a one-element array reference. β¨
the idea here? in R, 1:3 and list(1, 2, 3) can often be used interchangeably, even though the list is really made of three integer vectors, each of length one. and now both of them get the same native Perl representation:
[1, 2, 3]
so pretty. so convenient. π«Ά
heads up though: this only applies to elements that are atomic vectors. an element of type list will always be represented as an array reference:
"list(list(1), list(2), list(3))->to_pl" -> "[ [ 1 ], [ 2 ], [ 3 ] ]"
π BUGS AND LIMITATIONS π
classes in the REXP hierarchy are intended to be immutable. please, bestie, do not try to change their value or attributes. just let them be their main character selves. π
there are no known bugs in this module. for bug reporting, go see Statistics::R::IO. π
πΈ SUPPORT πΈ
see Statistics::R::IO for support and contact information. that's where the help lives.
π AUTHOR π
Davor Cubranic <cubranic@stat.ubc.ca> β icon, legend, the moment. π
π COPYRIGHT AND LICENSE π
This software is Copyright (c) 2017 by University of British Columbia.
This is free software, licensed under:
The GNU General Public License, Version 3, June 2007
slay. π
and that's a wrap on perl v5.34.0, dated 2022-02-10 β thanks for reading bestie, you ate this whole manual page, no crumbs. ππβ¨
π¦ where this page comes from
- debian bookworm: libstatistics-r-io-perl 1.0002-2 Β· GPL-3.0-only
- debian trixie: libstatistics-r-io-perl 1.0002-2 Β· GPL-3.0-only
- ubuntu jammy: libstatistics-r-io-perl 1.0002-2 Β· GPL-3.0-only
- ubuntu noble: libstatistics-r-io-perl 1.0002-2 Β· GPL-3.0-only
- ubuntu resolute: libstatistics-r-io-perl 1.0002-2 Β· GPL-3.0-only
- ubuntu stonking: libstatistics-r-io-perl 1.0002-2 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms