Skip to contents

Generate labels based in a data frame

Usage

label_print(
  label,
  mode = "sample",
  filename = "labels",
  margin = 0.04,
  paper = c(21, 29.7),
  units = "cm",
  viewer = FALSE,
  smpres = 200,
  nlabels = NA
)

Arguments

label

Data frame to build the labels or n repeated labels

mode

Label in "sample/preview" or "complete" mode

filename

Labels file name

margin

Labels margins. margin(t = 0, r = 0, b = 0, l = 0)

paper

Paper size. Default A4 (21.0 x 29.7)

units

Units for the label options

viewer

Show the sample in the "Plots" or "Viewer" panel

smpres

Sample resolution

nlabels

Number of labels to generate

Value

pdf

Examples


library(huito)

fb <- fieldbook

label <- fb %>% 
label_layout(size = c(10, 2.5)
             , border_color = "blue"
             ) %>%
  include_image(
    value = "https://flavjack.github.io/inti/img/inkaverse.png"
    , size = c(2.4, 2.4)
    , position = c(1.2, 1.25)
    ) %>%
  include_barcode(
    value = "barcode"
    , size = c(2.5, 2.5)
    , position = c(8.2, 1.25)
    ) %>%
  include_text(value = "plots"
               , position = c(9.7, 1.25)
               , angle = 90
               , size = 15
               , color = "red"
               ) %>%
  include_text(value = "Inkaverse"
               , position = c(4.6, 2)
               , size = 30
               , color = "brown"
               ) %>%
  include_text(value = "condition"
               , position = c(4.6, 1.2)
               , size = 13
               , color = "orange"
               ) %>%
  include_text(value = "genotypes"
               , position = c(4.6, 0.5)
               , size = 13
               , color = "#009966"
               ) %>% 
               label_print(mode = "sample")