Skip to content

User FAQ

faq-compatibility-types
FAQ - How is the compatibility of vector types decided?
faq-error-incompatible-attributes
FAQ - Error/Warning: Some attributes are incompatible
faq-error-scalar-type
FAQ - Error: Input must be a vector

Developer FAQ

howto-faq-coercion-data-frame
FAQ - How to implement ptype2 and cast methods? (Data frames)
howto-faq-coercion
FAQ - How to implement ptype2 and cast methods?
howto-faq-fix-scalar-type-error
FAQ - Why isn't my class treated as a vector?
theory-faq-coercion
FAQ - How does coercion work in vctrs?
reference-faq-compatibility
FAQ - Is my class compatible with vctrs?

Internal FAQ

internal-faq-matches-algorithm
Internal FAQ - Implementation of vec_locate_matches()
internal-faq-ptype2-identity
Internal FAQ - vec_ptype2(), NULL, and unspecified vectors

Genericity

vec_ptype2()
Find the common type for a pair of vectors
vec_cast() vec_cast_common()
Cast a vector to a specified type
vec_proxy() vec_restore()
Proxy and restore
vec_proxy_compare() vec_proxy_order()
Comparison and order proxy
vec_proxy_equal()
Equality proxy

Foundations

vec_data()
Extract underlying data
vec_ptype() vec_ptype_common() vec_ptype_show()
Find the prototype of a set of vectors
vec_size() vec_size_common() list_sizes() vec_is_empty()
Number of observations
vec_assert() vec_is()
Assert an argument has known prototype and/or size
vec_is_list() vec_check_list() list_all_vectors() list_check_all_vectors()
Is the object a list?

Combining

vec_c()
Combine many vectors into one vector
vec_interleave()
Interleave many vectors into one vector
vec_rbind() vec_cbind()
Combine many data frames into one data frame
name_spec
Name specifications

Slicing and recycling

vec_init()
Initialize a vector
vec_slice() `vec_slice<-`() vec_assign()
Get or set observations in a vector
vec_recycle() vec_recycle_common()
Vector recycling
vec_chop() vec_unchop()
Chopping
list_drop_empty()
Drop empty elements from a list

Assigning

vec_slice() `vec_slice<-`() vec_assign()
Get or set observations in a vector
vec_fill_missing()
Fill in missing values with the previous or following value

Equality and ordering

vec_equal() vec_equal_na()
Test if two vectors are equal
vec_detect_complete()
Complete
vec_compare()
Compare two vectors

Sorting

vec_order() vec_sort()
Order and sort vectors

Matching and splitting

vec_count()
Count unique values in a vector
vec_duplicate_any() vec_duplicate_detect() vec_duplicate_id()
Find duplicated values
vec_unique() vec_unique_loc() vec_unique_count()
Find and count unique values
vec_match() vec_in()
Find matching observations across vectors
vec_locate_matches()
Locate observations matching specified conditions
vec_split()
Split a vector into groups

Sequences and repetitions

New classes

Data frame

df_list()
Collect columns for data frame construction
new_data_frame()
Assemble attributes for data frame construction
data_frame()
Construct a data frame
df_ptype2() df_cast() tib_ptype2() tib_cast()
Coercion between two data frames

User tools

`%0%`
Default value for empty vectors

Developer tools

new_vctr()
vctr (vector) S3 class
vec_list_cast()
Cast a list to vector of specific type
vec_ptype_full() vec_ptype_abbr()
Vector type as a string
new_partial() is_partial() vec_ptype_finalise()
Partial type
stop_incompatible_type() stop_incompatible_cast() stop_incompatible_op() stop_incompatible_size() allow_lossy_cast()
Custom conditions for vctrs package
new_rcrd()
rcrd (record) S3 class
fields() n_fields() field() `field<-`()
Tools for accessing the fields of a record.
s3_register
Register a method for a suggested dependency
vec_arith() vec_arith_base() MISSING()
Arithmetic operations
vec_math() vec_math_base()
Mathematical operations
unspecified()
A 1d vector of unspecified type
vec_default_cast() vec_default_ptype2()
Default cast and ptype2 methods
vec_as_names()
Retrieve and repair names
vec_names2() vec_names() vec_set_names()
Get or set the names of a vector
vec_as_location() num_as_location() vec_as_location2() num_as_location2()
Create a vector of locations
vec_as_subscript() vec_as_subscript2()
Convert to a base subscript type