Learn R Programming

stringfish (version 0.19.2)

sf_vector: sf_vector

Description

Creates a new empty stringfish vector

Usage

sf_vector(len)

Value

A new empty stringfish vector

Arguments

len

length of the new vector

Details

This is a backwards-compatible alias for `sf_vector_create(len)`. It creates a new stringfish vector, an alt-rep character vector backed by a C++ "std::vector" as the internal memory representation. The vector type is "sfstring", which is a simple C++ class containing owned string bytes and a single byte (uint8_t) representing the encoding.

Examples

Run this code
x <- sf_vector(10)
sf_assign(x, 1, "hello world")
sf_assign(x, 2, "another string")

Run the code above in your browser using DataLab