fastqueue2: A Wrapper for 'fastmap::fastqueue'

Description Usage Arguments Value Examples

View source: R/fastqueue2.R

Description

A Wrapper for fastmap::fastqueue

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
fastqueue2(init = 20L, missing_default = NULL)

## S3 method for class 'fastqueue2'
x[[i]]

## S3 method for class 'fastqueue2'
x[i, j = NULL, ...]

## S3 method for class 'fastqueue2'
print(x, ...)

## S3 method for class 'fastqueue2'
length(x)

## S3 method for class 'fastqueue2'
as.list(x, ...)

Arguments

init, missing_default

passed to fastmap::fastqueue

x

a 'fastqueue2' object

i, j

integer index

...

integer indices or passed to other methods

Value

A list of 'fastqueue2' instance

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
x <- fastqueue2()

# add elements
x$madd(1, "b", function(){ "c" }, 4, "5")

# print information
print(x)

# get the second element without changing the queue
x[[2]]

# remove and get the first element
x$remove()

# the second item
x[[2]]

# first two items in a list
x[c(1,2)]

print(x)
as.list(x)

dipsaus documentation built on Sept. 6, 2021, 5:08 p.m.