Skip to contents

Filters MegaDetector/SpeciesNet JSON files to only data for images in the directory specified.

Usage

megadet_filter(json, dir = NULL, images = NULL, file = NULL, overwrite = FALSE)

Arguments

json

character vector or nested list object from jsonlite::read_json().

dir

character. Directory to be used to filter the JSON data. This folder should not be within the relative path of the file JSON tag, but should directly contain any folders that appear there. Mutually exclusive with images.

images

character vector. Vector of images to filter for. Files should be formatted with relative paths if applicable. Mutually exclusive with dir. The JSON file or loaded JSON data to filter on.

file

character. File to write JSON data to. Use NA to skip writing to a file.

overwrite

logical. If overwriting files is allowed.

Value

a nested list object with filtered JSON data.