finds_d2l: Convert Finds Data Frame (Context / Find-Type) to List Object

View source: R/eratosthenes.R

finds_d2lR Documentation

Convert Finds Data Frame (Context / Find-Type) to List Object

Description

Performs the opposite of finds_l2d. Takes a data.frame object of two columns, containing the context in the first and the find-type in the second, and returns a list object for input in gibbs_ad. The value of the find id is automatically generated as an integer if not provided in a third column.

Usage

finds_d2l(input)

## S3 method for class 'data.frame'
finds_d2l(input)

Arguments

input

A two-column data frame of contexts (first column) and find-types (second column). An optional third column of an id number may be provided.

Value

A list of finds (each one a list) associated with contexts and their types.

Examples

f1 <- list(id = "find01", assoc = "D", type = c("type1", "form1"))
f2 <- list(id = "find02", assoc = "E", type = c("type1", "form2"))
f3 <- list(id = "find03", assoc = "G", type = c("type1", "form1"))
f4 <- list(id = "find04", assoc = "H", type = c("type2", "form1"))
f5 <- list(id = "find05", assoc = "I", type = "type2")
f6 <- list(id = "find06", assoc = "H", type = NULL)

artifacts <- list(f1, f2, f3, f4, f5, f6)

# convert list to data frame
artifacts_df <- finds_l2d(artifacts)

# convert data frame to list
artifacts_list <- finds_d2l(artifacts_df)


eratosthenes documentation built on June 28, 2025, 1:08 a.m.