Learn R Programming

filesstrings (version 1.1.0)

put_in_pos: Put specified strings in specified positions in an otherwise empty character vector.

Description

Create a charachter vector with a set of strings at specified positions in that charachter vector, with the rest of it taken up by empty strings.

Usage

put_in_pos(strings, positions)

Arguments

strings

A charachter vector of the strings to put in positions (coerced by as.character if not charachter already).

positions

The indices of the charachter vector to be occupied by the elements of strings. Must be the same length as strings or of length 1.

Value

A charachter vector.

Examples

Run this code
# NOT RUN {
put_in_pos(1:3, c(1, 8, 9))
put_in_pos(c("Apple", "Orange", "County"), c(5, 7, 8))
put_in_pos(1:2, 5)
# }

Run the code above in your browser using DataLab