Skip to contents

Create value of items in a collection

Usage

value_of_items(collection, dependents = NA)

Arguments

collection

A data frame containing a collection.

dependents

A list of scoring systems, where a scoring system is a list of:

  • $column the column in the collection we are generating a score from.

  • $weight the weight of this score (multiplier), relative to other columns.

  • $details a data frame detailing the score for particular values found in the column. Where the values to match to the column are found in names and the score is contained in value.

  • $type The method for matching/finding entries in the column. Allowable values are 'Exact', 'Grepl', 'Number range' and 'Number range (int)'.

Value

A list of length two containing:

  • $total_value a vector of length nrow(collection) containing the value of each item in the collection.

  • $value_breakdown a data frame with nrow(collection) rows and length(dependents) columns giving the value of each dependent in corresponding columns.

Details

This function generates a value for each item in a collection given a users scoring system. The scoring system is provided via the input dependents. Please see the vignette Adding value to items in a collection for further documentation.