Learn R Programming

stringfish (version 0.16.0)

sf_vector: sf_vector

Description

Creates a new stringfish vector

Usage

sf_vector(len)

Value

A new (empty) stringfish vector

Arguments

len

length of the new vector

Details

This function 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 a "std::string" and a single byte (uint8_t) representing the encoding.

Examples

Run this code
if(getRversion() >= "3.5.0") {
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