LMc: LMc

Description Usage Arguments Examples

View source: R/LML.R

Description

Limited Memory concatenate. Adds new elements to front, removing oldest elements if new length is greater tham M.

Usage

1
LMc(new_el, old_list = NULL, M = 1)

Arguments

new_el

elements to add to top of vector, if length(new_el) > 1, then the new elements will be appended left to right (so that the last element will be the most recent).

old_list

elements to concatenate new_el with.

M

Memory, maximum number of elements (will truncate by removing oldest if length is greater than M). If M==0, the vector will have 'unlimited' memory.

Examples

1
2
3
4
5
6
7
8
a = LMc(1, M=5)
print(a)

a = LMc(c(2,3,4,5), a, M=5)
print(a)

a = LMc(c(6,7), a, M=5)
print(a)

mrparker909/LimitedMemoryList documentation built on Nov. 4, 2019, 7:35 p.m.