insert_at: insert elements in a vector at a specifik position

Description Usage Arguments Value Examples

View source: R/insert_at.R

Description

insert elements in a vector at a specifik position. can't be in the beginning of a vector, perhaps fix sometime #todo#

Usage

1
insert_at(vector1, pos, ...)

Arguments

vector1

a vector

pos

positions of were the elements/vectors should be inserted. Length must be the same as the number of vectors inserted.

...

vectors that should be inserted

Value

This function creates, by reference, four variables with run- and spell-length-type information.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# first example
a1 = c(1:10)
b1 = c('SE MIG')
c1 = c('A', 'B')

#indsaetter b efter 3. element og d efter 7. element i a 
insert_at(a1, c(3,7), b1, c1) 
#andet eksempel
insert_at(a1, c(4,7,9), "hello", "this", "world") 


## End(Not run)

emilBeBri/dttools documentation built on April 21, 2021, 5:44 a.m.