-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathREADME.Rmd
50 lines (36 loc) · 800 Bytes
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# queue
The goal of queue is to provide a simple on-disk queue data structure in R.
## Installation
You can install queue from github with:
```{r gh-installation, eval = FALSE}
# install.packages("remotes")
remotes::install_github("rdpeng/queue")
```
## Example
This is a basic example which shows you how to solve a common problem:
```{r example}
library(queue)
x <- create_queue("myqueue")
is_empty(x)
## Queue up some items
enqueue(x, 1)
enqueue(x, 2)
## Look at the head of the queue
peek(x)
## Retrieve some items
dequeue(x)
dequeue(x)
is_empty(x)
delete_queue(x)
```