pkgdown/google0acd00d8574ec2df.html

Skip to contents

Takes a numeric vector, and prints it to the console separated by ", ".

This allows the output to be copy-pasted into a vector within an R script. Used for taking vector outputs and then writing them as literals within a script.

E.g. when given input 1:5, prints 1, 2, 3, 4, 5, which can be directly copy-pasted within c() to input that vector. Printing normally via print(1:5) instead prints [1] 1 2 3 4 5, which is not valid vector input so can't be copy-pasted directly.

See debug_join_vector_str() for the equivalent for character/string vectors.

Usage

debug_join_vector_num(vector)

Arguments

vector

numeric vector. Usually generated by some other function. This function allows copy-pasting the output to directly create a vector with this value.

Examples

debug_join_vector_num(1:5)
#> 1, 2, 3, 4, 5