Awesome VectoRs
A curated list of amazingly awesome R vector classes, and the packages that provide them.
Contributing
Please read CONTRIBUTING if you wish to add a new vector class.
Table of Contents
- Awesome VectoRs
- Resources
Numbers
Classes that wrap numbers.
base
hexmode
- Hexadecimal numbers:2A
integer
- 32-bit integers:1
numeric
- Floating-point numbers:1.234567
numeric_version
- Software versions:'1.23.456'
octmode
- Octal numbers:52
bignum
bigfloat
- High precision numbers:0.33333333333333333333333333333333333333333333333333
biginteger
- Arbitrary precision integers:25852016738884976640000
debkeepr
deb_decimal
- Non-decimal currencies asdouble
withunit
andbases
attributes:3.825
deb_lsd
- Tripartite non-decimal currencies:8:13s:4d
deb_tetra
- Tetrapartite non-decimal currencies:8:13s:4d:3f
errors
fracture
nombre
pillar
quantities
quantities
- Numbers with units and uncertainty:1 ยฑ 0.3 [m/s]
units
Date and time
Classes that wrap dates and times.
aweek
aweek
- Weeks that start on any day of the week:2020-W10-2
base
POSIXct
- Calendar time with time zone, stored as days since epoch:2020-03-03 09:16:17 CET
POSIXlt
- Calendar time with time zone, stored as record of components:2020-03-03 09:16:17 CET
clock
calendar
- Alternative representations of calendar dates, such as year-quarter-day or year-month-weekday:2019-02-Sun[2]
time_point
- Variable precision points in time, with and without time zones:"2020-02-01 02:03:04.000005"
dint
date_y
- Years:2020
date_yq
- Year-quarter:2020-Q1
date_ym
- Year-month:2013-M12
date_yw
- Year-week:2013-W12
era
hms
intermittent
tsibble
Strings
Classes that wrap character strings.
base
pillar
Compound
Classes that wrap complex objects.
biblids
blob
blob
- Binary Large OBjects:blob[42 B]
dialr
phone
- Phone numbers parsed with Google's libphonenumber for formatting and further processing:# Parsed phone numbers: 5 total, 4 successfully parsed
haven
labelled
- Labelled vectors:<Labelled double> 3
with labels
intrval
intrval
- Relational operators for intervals:x %[]% c(a, b)
ivs
iv
- Interval vectors:[2019-01-05, 2019-05-06) [2019-01-06, 2019-05-22)
units
mixed_units
- Numbers with different units:1 [m], 2 [kg]
term
Computing
Classes related to computing
ipaddress
ip_address
- IP address:192.168.0.1
ip_interface
- IP interface:192.168.0.1/24
ip_network
- IP network:192.168.0.0/24
Geospatial
Classes related to geospatial
geos
geos_geometry
- Geometry vector as GEOS external pointers:<POINT (0 1)>
s2
s2_geography
,s2_cell
- Geometry vector of points on the sphere as external pointers to S2 objects, S2 cell IDs as 64-bit integers:<POINT (0 1)>
sf
sfc
- Geometry vector in spatial data frames:POINT (0 1)
wk
crc
- Circle:[1 2, r = 0.5]
wkb
- Well-known binary geometry:<POINT (0 1)>
wkt
- Well-known text geometry:POINT (0 1)
xy
- Points:(1 4)
rct
- Rectangle:[1 2 3 4]
Internal
Classes implemented by packages for their own use
textrecipes
tokenlist
- List of tokens:[3 tokens]
with number of unique tokens
Colours
Classes related to colours
palettes
-
palettes_colour
- Colours:$\color{red}{\bullet}$ #FF0000
-
palettes_palette
- Colour palettes:$\color{red}{\bullet}$ #FF0000
Resources
Books
- Advanced R by Hadley Wickham
Repositories
- vctrs: simplifies creating vector classes
Blog posts
- Earo Wang: A practical guide to vctrs-powered S3 programming: using vctrs for turtle graphics
Talks
- Jesse Sadler, vctrs: Creating custom vector classes with the vctrs package at RStudio::conf2020 with the companion tutorial debvctrs
License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International license.