InsectLabelR is an R package designed to streamline the creation of high-quality labels for insect pinning. By taking a dataset as input, InsectLabelR generates printable labels in PDF format, helping researchers and entomologists maintain accurate and standardized specimen records.
For enhanced accessibility, the package includes a user-friendly Shiny application, which provides a graphical interface for generating labels without requiring programming expertise and detailed user guides in both English and French .
To install the InsectLabelR package, use the following command in R:
# Install from GitHub
devtools::install_github("Nmoiroux/InsectLabelR")
The Shiny app provides an intuitive interface for generating insect pinning labels. You can access it online at InsectLabelR or run it locally:
InsectLabelR_App()
Steps to Use the Shiny App:
.csv, .xlsx, or .ods file containing your insect data.
.xlsx or .ods, select the appropriate sheet containing the dataset.Your dataset must include:
.csv (tab-delimited), .xlsx, .ods..xlsx or .ods file containing the Data table, or as a .csv file (tab-delimited).field_name, print, label_no, order_lab, and more.Example data and parameter tables are provided in the InsectLabelR repository.
InsectLabelR provides programmatic access to its core functionality. Below is an example using the create_pdf() function with a dataset embedded in the package.
# Example dataset path (included in the package)
data_path <- system.file("extdata", "liste_ind_coll_ex.ods", package = "InsectLabelR")
# Load data table
data_table <- readODS::read_ods(data_path, sheet = "Table_data")
# Load print parameter data
par_table <- readODS::read_ods(data_path, sheet = "Print_parameters_ex1")
# Define output file path for the PDF
output_pdf <- "example_labels.pdf"
# Generate labels
InsectLabelR::create_pdf(
file_out = output_pdf, # Name of pdf file
ind_list = data_table , # Table of data
print_info = par_table, # Table of printing parameters
font_size = 5, # Font size
lab_width = 15, # Width of the labels in mm
lab_height =12, # Height of the labels in mm
n_col = 8, # Number of label columns per row
hl_col = "orange" # Color for highlighted text
)
This script:
.ods dataset included in the package.The generated example_labels.pdf file will contain insect pinning labels formatted according to the specified parameters.
dplyr, purrr, stringr, magrittr, shiny
pdflatex see https://www.latex-project.org/get/. For Debian or Debian-based (Ubuntu...) Linux distributions, the following commands should ensure a compatible pdflatex install:sudo apt-get install texlive-latex-base
sudo apt-get install texlive-latex-extra