| create_PDF {baRcodeR} | R Documentation |
Input vector or data.frame of ID codes to produce a PDF of QR codes which can
be printed. This is a wrapper function for custom_create_PDF
create_PDF(user = FALSE, Labels = NULL, name = "LabelsOut", ErrCorr = "H", Fsz = 2.5, ...)
user |
logical. Run function using interactive mode (prompts user for
parameter values) Default is |
Labels |
vector or data frame object containing label names (i.e. unique ID codes). |
name |
character. Name of the PDF output file. Default is |
ErrCorr |
error correction value. Level of damage from low to high:
|
Fsz |
numerical. Sets font size using a number between |
... |
advanced arguments to modify the PDF layout. See
|
a PDF file containing QR-coded labels, saved to the default directory.
The default PDF setup is for ULINE 1.75" * 0.5" WEATHER RESISTANT LABEL for laser
printer; item # S-19297 (uline.ca). The page format can be modified using
the ... (advanced arguments) for other label types.
## data frame
example_vector <- as.data.frame(c("ao1", "a02", "a03"))
## Not run:
## run with default options
## pdf file will be "example.pdf" saved into a temp directory
create_PDF(Labels = example_vector, name = file.path(tempdir(), "example"))
## view example output from temp folder
system(paste0('open "', file.path(tempdir(), "example"), ".pdf"))
## End(Not run)
## run interactively. Overrides default pdf options
if(interactive()){
create_PDF(user = TRUE, Labels = example_vector)
}
## run using a data frame, automatically choosing the "label" column
example_df <- data.frame("level1" = c("a1", "a2"), "label" = c("a1-b1",
"a1-b2"), "level2" = c("b1", "b1"))
create_PDF(user = FALSE, Labels = example_df, name = file.path(tempdir(), "example_2"))
## run using an unnamed data frame
example_df <- data.frame(c("a1", "a2"), c("a1-b1", "a1-b2"), c("b1", "b1"))
## specify column from data frame
create_PDF(user = FALSE, Labels = example_df[,2], name = file.path(tempdir(), "example_3"))