repo_sys: Run system call on an item

Description Usage Arguments Value Examples

View source: R/repo_public.R

Description

Runs a system command passing as parameter the file name containing the object associated with an item.

Usage

1
repo_sys(name, command)

Arguments

name

Name of a repo item. The path to the file that contains the item will be passed to the system program.

command

System command

Value

Used for side effects.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Repository creation
rp_path <- file.path(tempdir(), "example_repo")
rp <- repo_open(rp_path, TRUE)

## Creating a PDF file with a figure.
pdffile <- file.path(rp_path, "afigure.pdf")
pdf(pdffile)
plot(runif(30), runif(30))
dev.off()

## Attaching the PDF file to the repo
rp$attach(pdffile, "A plot of random numbers", "repo_sys")
## don't need the original PDF file anymore
file.remove(pdffile)

## Opening the stored PDF with Evince document viewer
## Not run: 
rp$sys("afigure.pdf", "evince")

## End(Not run)

## wiping temporary repo
unlink(rp_path, TRUE)

franapoli/repo documentation built on May 17, 2021, 7:24 p.m.