Statis...:Vector(3pm)

πŸ’– Statistics::R::REXP::Vector β€” the R vector bestie πŸ’–

okay so real talk, this is the Statistics::R::REXP::Vector page from the Perl docs (section 3pm, user contributed, iykyk) and it's literally all about representing an R vector in Perl land. sit down, get comfy, we're doing this 🫢


✨ VERSION ✨

version 1.0002 β€” that's the one, that's the era we're in πŸ’…


🌈 SYNOPSIS 🌈

like, here's the vibe in code form:

use Statistics::R::REXP::Vector;

# $vec is an instance of Vector
$vec->does('Statistics::R::REXP::Vector');
print $vec->elements;

see how $vec is an instance of Vector and then we just... ask it for its elements? iconic behavior fr fr ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so an object of this class is the Perl-side glow-up of an R vector. but here's the tea bestie: you cannot directly instantiate this class. like, it will straight up die if you call new on it πŸ’€. why? because it's a base abstract class β€” it's the blueprint, not the building. the actual concrete subclasses are the ones that represent specific types of vectors, like numeric or list. so you don't date the abstract class, you date its subclasses, periodt πŸ‘‘


πŸ’… METHODS πŸ’…

Statistics::R::REXP::Vector inherits from Statistics::R::REXP. so everything good from the parent? already in the group chat.

πŸŽ€ ACCESSORS πŸŽ€

  • elements β€” hands you an array reference to the vector's elements. that's it, that's the whole job, and it does it beautifully πŸ“
  • to_pl β€” the Perl value of the language vector, which is an array reference to the Perl values of its elements. (aka it's equivalent to map {$_-"to_pl}, $vec->elements>.) yeah the original text really does have that quote situation going on in there, we keep it exactly as-is, no cap πŸ™ˆ
  • type β€” a human-friendly description of the vector type (like "double" vs. "list"). and if you want the true R type instead of the cute nickname? go use sexptype. two different queens, two different jobs πŸ‘‘

😭 BUGS AND LIMITATIONS 😭

  • the classes in the REXP hierarchy are intended to be immutable. so please, bestie, do not try to change their value or attributes. they said what they said and they're not changing for you πŸ’€
  • there are no known bugs in this module. for bug reporting, go look at Statistics::R::IO. they're handling it 🫢

🌸 SUPPORT 🌸

for support and contact info, see Statistics::R::IO. that's the mutuals you hit up πŸ’œ


πŸ‘‘ AUTHOR πŸ‘‘

Davor Cubranic <cubranic@stat.ubc.ca> β€” the legend, the main character who wrote this ✨


this software is Copyright (c) 2017 by University of British Columbia.

and it's free software, licensed under:

The GNU General Public License, Version 3, June 2007

so yeah, free as in freedom, go wild (responsibly) 🌈


and that's the whole page bestie!! this was perl v5.34.0, dated 2022-02-10, and honestly? it ate. no crumbs. go forth and vector responsibly πŸ’–βœ¨πŸ¦‹