delete_itemsInLevel {emuR}R Documentation

Delete items programmatically

Description

Delete annotation items programmatically. You have to pass in a data frame, called itemsToDelete, describing these items. The required columns are described below.

This function belongs to emuR’s CRUD family of functions, which let the user manipulate items programmatically:

Usage

delete_itemsInLevel(
  emuDBhandle,
  itemsToDelete,
  sayYes = FALSE,
  rewriteAllAnnots = TRUE,
  verbose = TRUE
)

Arguments

emuDBhandle

emuDB handle as returned by load_emuDB

itemsToDelete

A data frame with the columns:

  • session (character)

  • bundle (character)

  • start_item_id (numeric)

sayYes

When you call this function, it warns you about problems it may create. You can skip that question if you set the sayYes parameter to TRUE. This is useful when you want to use the function non-interactively.

rewriteAllAnnots

should changes be written to file system (_annot.json files) (intended for expert use only)

verbose

if set to TRUE, more status messages are printed

Details

This function deletes annotation items from existing levels. Your input data frame itemsToDelete must describe the items by specifying the columns session, bundle, and start_item_id.

Be careful with this function: You can use it to create problematic situations, for example gaps in the annotation levels, and the function currently has no checks to prevent this. Instead, you need to explicitly confirm that you are aware of this, either by setting sayYes to TRUE or by interactively responding yes to the prompt this function presents.

A major use case for this function is to obtain a segment list using query, possibly modify the segment list and feed it to this function. That is why the column start_item_id is not called item_id: segment lists include the former column name, not the latter.


[Package emuR version 2.5.0 Index]