collection: Create a list of symbols

View source: R/collection.R

collectionR Documentation

Create a list of symbols

Description

From a file containing SVG files, extracts all the SVGs into a list of symbols that can be used in lithologs.

Usage

collection(dir = getwd())

is.collection(collection)

plot_collection(
  collection,
  col = "grey90",
  cex = 2,
  as.pdf = T,
  name = "symbols",
  ext = ".pdf",
  dir = tempdir(),
  width = 7,
  height = 0.8 * width/5.6,
  track = T,
  openfile = T
)

Arguments

dir

the file where the document will be saved (by default a temporary directory, tempdir())

collection

an object similar to the output of collection()

col

the background colour of the symbols

cex

the size of the text in the plot

as.pdf

whether to output the plot as a pdf

name

the name of the pdf document to plot the symbols of a collection

ext

the extension of the document: ".pdf" by default, but ".svg" works also.

width

the width of the drawing area (in inches)

height

the height of the drawing area (in inches)

track

whether to generate different files for each rerun of pdfDisplay with identical 'name'. The name will be followed by '_(i)' where i is the version number. With this you avoid closing your pdf file at each rerun if your pdf reader is not able to deal with (to my knowledge only SumatraPDF is able)

openfile

should the pdf file be opened (for the moment works only in Windows). Use SumatraPDF as default pdf reader to be able to write over current file

Value

a collection is a list of pointsvg-objects (see pointsvg)

Examples

# To show you how to import, we first have to have a svg file to import. The
# following lines of code will create a svg in a temporary files:

# 1. Create temporary file
svg.file.directory <- tempfile(pattern = "ammonite",
                               fileext = ".svg")
# 2. Write the svg in the file
writeLines(example.ammonite.svg, svg.file.directory)

print(paste("An example .svg file was created at ", svg.file.directory,
            sep = ""))

coll <- collection(dirname(svg.file.directory))

is.collection(coll)

## Not run: 
plot_collection(coll, cex = 1.5)

plot_collection(oufti99, name = "Oufti99")
## End(Not run)


StratigrapheR documentation built on July 9, 2023, 6:02 p.m.