### Install tibblify Source: https://github.com/wranglezone/tibblify/blob/main/README.md Installation commands for the released CRAN version and the development version from GitHub. ```r install.packages("tibblify") ``` ```r # install.packages("pak") pak::pak("wranglezone/tibblify") ``` -------------------------------- ### Handle type conversion errors in tibblify Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tibblify.md These examples demonstrate how tibblify throws an error when input data cannot be converted to the target type. ```R (expect_error(tib(list(x = "a"), tib_lgl_vec("x")))) ``` ```R (expect_error(tib(list(x = "a"), tib_lgl("x")))) ``` ```R (expect_error(tib(list(x = 1), tib_scalar("x", dtt)))) ``` -------------------------------- ### Handle missing required fields in tibblify Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tibblify.md These examples demonstrate how tibblify throws an error when a specified field is missing from the input list. ```R (expect_error(tib(list(a = 1), tib_lgl("x")))) ``` ```R (expect_error(tib(list(a = 1), tib_scalar("x", dtt)))) ``` ```R (expect_error(tib(list(a = 1), tib_lgl_vec("x")))) ``` ```R (expect_error(tib(list(a = 1), tib_vector("x", dtt)))) ``` -------------------------------- ### Format tib_vector objects Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/format-tib.md Examples of various tib_vector configurations and their printed output. ```R tib_chr_vec("a") ``` ```R tib_vector("a", .ptype = vctrs::new_duration()) ``` ```R tib_vector("a", .ptype = vctrs::new_duration(), .input_form = "object", .values_to = "vals", .names_to = "names") ``` ```R tib_int_vec("a", .fill = 1:2) ``` ```R tib_int_vec(.key = "x", .ptype_inner = character(), .fill = 1:2) ``` ```R tib_lgl_vec("lgl") ``` ```R tib_int_vec("int") ``` ```R tib_dbl_vec("dbl") ``` ```R tib_chr_vec("chr") ``` ```R tib_date_vec("date") ``` -------------------------------- ### Prepare Data for Rectangling Source: https://github.com/wranglezone/tibblify/blob/main/README.md Load necessary libraries and prepare a subset of GitHub user data for conversion. ```r library(tibblify) library(repurrrsive) gh_users_small <- purrr::map( repurrrsive::gh_users, ~ .x[c("followers", "login", "url", "name", "location", "email", "public_gists")] ) names(gh_users_small[[1]]) ``` -------------------------------- ### Format tib_df objects Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/format-tib.md Demonstrates the formatting output for tib_df with different parameter configurations. ```R tib_df("formats", text = tib_chr("text", .fill = NA_character_)) ``` ```R tib_df("formats", text = tib_chr("text"), .required = FALSE) ``` ```R tib_df("formats", .names_to = "nms", text = tib_chr("text")) ``` -------------------------------- ### Inform about unspecified elements Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/guess_tspec_object.md Demonstrates how to enable notifications for unspecified fields within the object specification. ```R guess_tspec_object(x, inform_unspecified = TRUE) ``` -------------------------------- ### Format tib_row Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/format-tib.md Demonstrates formatting behavior for tib_row, including nested structures and optional arguments. ```R tib_row("formats", text = tib_chr("text", .fill = NA_character_)) ``` ```R tib_row("formats", text = tib_chr("text"), .required = FALSE) ``` ```R tib_row("basic_information", labels = tib_row("labels", name = tib_chr("name"), entity_type = tib_chr("entity_type"), catno = tib_chr("catno"), resource_url = tib_chr( "resource_url"), id = tib_int("id"), entity_type_name = tib_chr( "entity_type_name")), year = tib_int("year"), master_url = tib_chr( "master_url", .fill = NA), artists = tib_df("artists", join = tib_chr("join"), name = tib_chr("name"), anv = tib_chr("anv"), tracks = tib_chr("tracks"), role = tib_chr( "role"), resource_url = tib_chr("resource_url"), id = tib_int("id")), id = tib_int( "id"), thumb = tib_chr("thumb"), title = tib_chr("title"), formats = tib_df( "formats", descriptions = tib_chr_vec("descriptions", .fill = NULL), text = tib_chr( "text", .fill = NA), name = tib_chr("name"), qty = tib_chr("qty")), cover_image = tib_chr("cover_image"), resource_url = tib_chr("resource_url"), master_id = tib_int("master_id")) ``` -------------------------------- ### Format tib_variant objects Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/format-tib.md Demonstrates the formatting output for tib_variant with various arguments. ```R tib_variant("a") ``` ```R tib_variant("a", .fill = tibble(a = 1:2)) ``` ```R tib_variant("a", .elt_transform = as.character) ``` -------------------------------- ### Guess specification for discog data Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/guess_tspec_object_list.md Infers the tibblify specification for the discog dataset from the repurrrsive package. ```R guess_tspec_object_list(repurrrsive::discog) ``` -------------------------------- ### Format tib_chr_date_vec Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/format-tib.md Demonstrates formatting behavior for tib_chr_date_vec with and without optional arguments. ```R tib_chr_date_vec("a") ``` ```R tib_chr_date_vec("a", .required = FALSE, .fill = as.Date("2022-01-01"), .format = "%Y") ``` -------------------------------- ### Format tib_chr_date Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/format-tib.md Demonstrates formatting behavior for tib_chr_date with and without optional arguments. ```R tib_chr_date("a") ``` ```R tib_chr_date("a", .required = FALSE, .fill = "2022-01-01", .format = "%Y") ``` -------------------------------- ### Guess specification for gsoc-2018 JSON Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/guess_tspec_object_list.md Infers the tibblify specification from a local JSON file named gsoc-2018.json. ```R guess_tspec_object_list(read_sample_json("gsoc-2018.json")) ``` -------------------------------- ### Fully qualify tib calls Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/format-tib.md Use the fully_qualify argument in print to display the full namespace of the tib function. ```R print(tib_int("a"), fully_qualify = TRUE) ``` -------------------------------- ### Guess specification for gh_users data Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/guess_tspec_object_list.md Infers the tibblify specification for the gh_users dataset from the repurrrsive package. ```R guess_tspec_object_list(repurrrsive::gh_users) ``` -------------------------------- ### Format tib_int with arguments Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/format-tib.md Displays the output format for tib_int when using fill and transform arguments. ```R tib_int("a", .fill = NA_integer_) ``` ```R tib_int("a", .fill = 1) ``` ```R tib_int("a", .transform = as.integer) ``` ```R tib_int("a", .fill = NA_integer_, .transform = as.integer) ``` -------------------------------- ### Format scalar tibblify specifications Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/format-tib.md Displays the output format for various scalar tibblify specification functions. ```R tib_chr("a") ``` ```R tib_date("a") ``` ```R tib_dbl("a") ``` ```R tib_int("a") ``` ```R tib_lgl("a") ``` ```R tib_variant("a") ``` -------------------------------- ### Format tib_unspecified Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/format-tib.md Displays the output format for an unspecified tibblify specification. ```R tib_unspecified("a") ``` -------------------------------- ### Inform about unspecified elements Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/guess_tspec_df.md Shows how to enable informational messages for unspecified fields in the dataframe. ```R guess_tspec_df(tibble(lgl = NA), inform_unspecified = TRUE) ``` -------------------------------- ### Error on empty keys Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/untibblify.md This snippet demonstrates the error triggered when an empty key is provided to the internal check function. ```R (expect_error(.check_key_length_1(key = character(0)))) ``` -------------------------------- ### Format tib_int with key and inner ptype Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/format-tib.md Displays the output format for tib_int when specifying a key and inner prototype. ```R tib_int(.key = "x", .ptype_inner = character(), .fill = "a") ``` -------------------------------- ### Test tspec_combine error for different names_to Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/spec_combine.md Verifies that tspec_combine throws an error when names_col configurations are incompatible. ```R (expect_error(tspec_combine(spec1, spec2))) ``` ```R (expect_error(tspec_combine(spec1_df, spec2_df))) ``` -------------------------------- ### Handle unknown spec types Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/spec_combine.md Triggers an internal error when an unrecognized spec type is provided. ```R (expect_error(tspec_combine(df_spec, df_spec))) ``` -------------------------------- ### Format tib_recursive objects Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/format-tib.md Demonstrates the formatting output for recursive tibble structures. ```R tib_recursive("data", .children = "children", tib_int("id"), tib_chr("name")) ``` ```R tib_recursive("data", .children = "children", tib_int("id"), tib_chr("name"), .required = FALSE) ``` -------------------------------- ### Verify tspec_object output Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/format-tibblify_object.md Demonstrates the structure of the output when tibblify is applied to a list using tspec_object. ```R tibblify(list(a = 1L), tspec_object(tib_int("a"))) ``` -------------------------------- ### Handle child type mismatch Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/unnest_tree.md Demonstrates error handling when child nodes contain incompatible data types for the ID column. ```R (expect_error(unnest_tree(df, id, children))) ``` -------------------------------- ### Guess specification for citm_catalog Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/guess_tspec_object.md Shows the generated specification structure for a complex object when simplify_list is disabled. ```R guess_tspec_object(x, simplify_list = FALSE) ``` -------------------------------- ### Rectangle Data with Custom Specification Source: https://github.com/wranglezone/tibblify/blob/main/README.md Use guess_tspec to generate a schema and modify it before applying it to the conversion process. ```r spec <- guess_tspec(gh_users_small, inform_unspecified = FALSE) # Drop the unused email specification. spec$fields$email <- NULL tibblify(gh_users_small, spec = spec) ``` -------------------------------- ### Fully qualify tspec calls Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/format-tspec.md Printing tspec objects with fully qualified namespace prefixes. ```R print(tspec_df(tib_int("a")), fully_qualify = TRUE) ``` -------------------------------- ### Format tib_scalar with ptype Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/format-tib.md Displays the output format for tib_scalar with a specific prototype. ```R tib_scalar("a", .ptype = new_difftime(units = "mins")) ``` -------------------------------- ### Format tib_row Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/format-tib.md Displays the output format for a row-based tibblify specification. ```R tib_row("a", x = tib_int("x"), y = tib_dbl("y", .fill = NA_real_), z = tib_chr( "z", .fill = "abc")) ``` -------------------------------- ### Inform about unspecified fields Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/spec_inform_unspecified.md Reports unspecified fields in the provided spec as a message. ```R .spec_inform_unspecified(spec) ``` ```R .spec_inform_unspecified(spec, "error") ``` -------------------------------- ### Error handling for missing fields in tib_df Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tibblify.md Demonstrates error messages when a required field is missing from a list element within a tib_df specification. ```R (expect_error(tibblify(list(list(x = list(list(a = TRUE), list(a = FALSE))), list(a = 1)), tspec_df(x = tib_df("x", a = tib_lgl("a")))))) ``` ```R (expect_error(tibblify(list(list(x = list(list(a = TRUE), list()))), tspec_df( x = tib_df("x", a = tib_lgl("a")))))) ``` -------------------------------- ### Error on nested or non-character keys Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/untibblify.md These snippets demonstrate errors triggered when untibblify encounters unsupported spec key types. ```R (expect_error(untibblify(tibble(x = 1), spec))) ``` ```R (expect_error(untibblify(tibble(x = 1), spec))) ``` -------------------------------- ### Validate nest_tree input arguments Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/nest_tree.md These snippets demonstrate the error handling behavior of nest_tree when provided with invalid data frames, incorrect column selections, or conflicting argument values. ```R (expect_error(nest_tree(1L), class = "tibblify-error-invalid_data_frame")) ``` ```R (expect_error(nest_tree(df, "not-there"), class = "vctrs_error_subscript_oob")) ``` ```R (expect_error(nest_tree(df, 1:2), class = "tibblify-error-invalid_column_selection") ) ``` ```R (expect_error(nest_tree(df, id, parent_col = "not-there"), class = "vctrs_error_subscript_oob") ) ``` ```R (expect_error(nest_tree(df, id, parent_col = 1:2), class = "tibblify-error-invalid_column_selection") ) ``` ```R (expect_error(nest_tree(df, id, parent_col = id), class = "tibblify-error-args_same_value") ) ``` ```R (expect_error(nest_tree(df, id, parent, children_to = 1L), class = "vctrs_error_cast") ) ``` ```R (expect_error(nest_tree(df, id, parent, children_to = c("a", "b")), class = "vctrs_error_assert_size") ) ``` ```R (expect_error(nest_tree(df, id, parent, children_to = "id"), class = "tibblify-error-args_same_value") ) ``` ```R (expect_error(nest_tree(df, id, parent, children_to = "parent"), class = "tibblify-error-args_same_value") ) ``` -------------------------------- ### Handle empty input in guess_tspec_list Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/guess_tspec_list.md Validates that guess_tspec_list throws an error when provided with an empty list. ```R (expect_error(guess_tspec_list(list()))) ``` -------------------------------- ### Validate .names_to argument and combinations Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tib_spec_basics.md Ensures .names_to is correctly specified and compatible with other arguments. ```r (expect_error(tib_vector("x", integer(), .input_form = "scalar_list", .values_to = "val", .names_to = "name"))) ``` ```r (expect_error(tib_vector("x", integer(), .input_form = "object", .names_to = "name")) ) ``` ```r (expect_error(tib_vector("x", integer(), .input_form = "object", .values_to = "val", .names_to = "val"))) ``` ```r (expect_error(tib_vector("x", integer(), .input_form = "object", .values_to = "val", .names_to = 1))) ``` ```r (expect_error(tib_vector("x", integer(), .input_form = "object", .values_to = "val", .names_to = c("a", "b")))) ``` -------------------------------- ### Format long lines in tib_row Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/format-tib.md Demonstrates how tib_row objects wrap based on the specified print width. ```R print(tib_row("path", a_long_name = tib_dbl("a looooooooooooooooooooong name", .fill = 1)), width = 60) ``` ```R print(tib_row("path", a_long_name = tib_dbl("a looooooooooooooooooooong name", .fill = 1)), width = 69) ``` -------------------------------- ### Define column mappings using lcols Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/data/format_lcols_default.txt Maps specific fields to column types and defines a default fill behavior for missing values. ```R lcols( instance_id = lcol_int("instance_id"), date_added = lcol_chr("date_added"), .fill = lcol_chr(zap()) ) ``` -------------------------------- ### Test recursive tibblify error Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/spec_prep_recursive.md Verifies that tibblify correctly identifies and reports the path to an invalid value during recursive processing. ```R (expect_error(tibblify(x2, spec))) ``` -------------------------------- ### Validate unnest_tree arguments Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/unnest_tree.md These snippets demonstrate error handling for unnest_tree when provided with invalid inputs or conflicting arguments. ```R (expect_error(unnest_tree(1L))) ``` ```R (expect_error(unnest_tree(df, id_col = "not-there"))) ``` ```R (expect_error(unnest_tree(df, id_col = 1:2))) ``` ```R (expect_error(unnest_tree(df, id_col, children = "not-there"))) ``` ```R (expect_error(unnest_tree(df, id_col, children = 1:2))) ``` ```R (expect_error(unnest_tree(df, children, children))) ``` ```R (expect_error(unnest_tree(df, id, children, level_to = 1L))) ``` ```R (expect_error(unnest_tree(df, id, children, level_to = "id"))) ``` ```R (expect_error(unnest_tree(df, id, children, level_to = c("a", "b")))) ``` ```R (expect_error(unnest_tree(df, id, children, parent_to = "level"))) ``` ```R (expect_error(unnest_tree(df, id, children, parent_to = 1L))) ``` ```R (expect_error(unnest_tree(df, id, children, parent_to = "id"))) ``` ```R (expect_error(unnest_tree(df, id, children, parent_to = c("a", "b")))) ``` ```R (expect_error(unnest_tree(df, id, children, ancestors_to = "level"))) ``` ```R (expect_error(unnest_tree(df, id, children, ancestors_to = "parent"))) ``` ```R (expect_error(unnest_tree(df, id, children, ancestors_to = 1L))) ``` ```R (expect_error(unnest_tree(df, id, children, ancestors_to = "id"))) ``` ```R (expect_error(unnest_tree(df, id, children, ancestors_to = c("a", "b")))) ``` -------------------------------- ### Non-API C Call Note Source: https://github.com/wranglezone/tibblify/blob/main/cran-comments.md A note generated by R CMD check regarding the use of non-API entry points in compiled code. ```text Check: compiled code Result: NOTE File ‘tibblify/libs/tibblify.so’: Found non-API calls to R: ‘PRENV’, ‘PRVALUE’, ‘R_PromiseExpr’, ‘Rf_allocSExp’, ‘Rf_findVarInFrame3’, ‘SETLENGTH’, ‘SET_GROWABLE_BIT’, ‘SET_PRCODE’, ‘SET_PRENV’, ‘SET_PRVALUE’, ‘SET_TRUELENGTH’ Compiled code should not call non-API entry points in R. See ‘Writing portable packages’ in the ‘Writing R Extensions’ manual, and section ‘Moving into C API compliance’ for issues with the use of non-API entry points. Flavors: r-oldrel-macos-arm64, r-oldrel-macos-x86_64 ``` -------------------------------- ### Validate scalar size constraints Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tibblify.md Demonstrates errors triggered when a field expected to be a scalar receives a vector of size greater than one. ```R (expect_error(tib(list(x = c(TRUE, TRUE)), tib_lgl("x")))) ``` ```R (expect_error(tib(list(x = c(dtt, dtt)), tib_scalar("x", dtt)))) ``` -------------------------------- ### Validate .input_form argument Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tib_spec_basics.md Ensures .input_form is one of the allowed values. ```r (expect_error(tib_vector("x", integer(), .input_form = "v"))) ``` -------------------------------- ### Format nested tspec Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/format-tspec.md Formatting a nested tspec structure. ```R format(tspec_df(a = tib_int("a"), b = tib_df("b", x = tib_int("x")))) ``` -------------------------------- ### Validate error conditions for guess_tspec_df Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/guess_tspec_df.md Demonstrates how guess_tspec_df throws errors when provided with invalid input types. ```R (expect_error(guess_tspec_df(list(a = 1)))) ``` ```R (expect_error(guess_tspec_df(1:3))) ``` -------------------------------- ### Validate tib_df() .names_to argument Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tib_spec_other.md Demonstrates the error triggered when .names_to is not a single string. ```r (expect_error(tib_df("x", .names_to = 1))) ``` -------------------------------- ### Test tspec_combine input form incompatibility Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/spec_combine.md Verifies that tspec_combine throws an error when attempting to combine specifications with incompatible input forms. ```R (expect_error(tspec_combine(spec_vec, spec_vec_scalar))) ``` ```R (expect_error(tspec_combine(spec_vec, spec_vec_object))) ``` ```R (expect_error(tspec_combine(spec_vec_scalar, spec_vec_object))) ``` ```R (expect_error(tspec_combine(spec_scalar, spec_vec_object))) ``` -------------------------------- ### Validate .key argument in tib_scalar Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tib_spec_basics.md Tests for various invalid inputs to the .key parameter, including empty, NA, and non-character values. ```R (expect_error(tib_scalar(character(), logical()))) ``` ```R (expect_error(tib_scalar(NA_character_, logical()))) ``` ```R (expect_error(tib_scalar("", logical()))) ``` ```R (expect_error(tib_scalar(1L, logical()))) ``` ```R (expect_error(tib_scalar(c("x", NA), logical()))) ``` ```R (expect_error(tib_scalar(c("x", ""), logical()))) ``` -------------------------------- ### Handle invalid objects in guess_tspec_list Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/guess_tspec_list.md Demonstrates error reporting for lists that fail to meet the criteria for objects or lists of objects. ```R (expect_error(guess_tspec_list(list(a = 1, 1)))) ``` ```R (expect_error(guess_tspec_list(list(a = 1, a = 1)))) ``` -------------------------------- ### Validate object names in tibblify Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tibblify.md Checks that objects passed to tibblify have valid, non-empty, and unique names. ```r (expect_error(tibblify(list(1, 2), spec))) ``` ```r (expect_error(tibblify(list(x = 1, 2), spec))) ``` ```r (expect_error(tibblify(list(1, x = 2), spec))) ``` ```r (expect_error(tibblify(list(z = 1, y = 2, 3, a = 4), spec))) ``` ```r (expect_error(tibblify(rlang::set_names(list(1, 2), c("x", NA)), spec))) ``` ```r (expect_error(tibblify(list(x = 1, x = 2), spec))) ``` -------------------------------- ### Test incompatible default value combinations Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/spec_combine.md Verifies that tspec_combine raises an error when combining specifications with conflicting default values. ```R (expect_error(tspec_combine(spec_no_default, spec_default1))) ``` ```R (expect_error(tspec_combine(spec_default1, spec_default2))) ``` ```R (expect_error(tspec_combine(spec_no_default_vec, spec_default1_vec))) ``` ```R (expect_error(tspec_combine(spec_default1_vec, spec_default2_vec))) ``` -------------------------------- ### Validate tib_vector object parsing Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tibblify.md Demonstrates error conditions when parsing objects with tib_vector, such as missing names, incorrect types, or invalid element sizes. ```r (expect_error(tib(list(x = list(1, 2)), spec))) ``` ```r (expect_error(tib(list(x = 1), spec))) ``` ```r (expect_error(tib(list(x = list(a = 1, b = 1:2)), spec))) ``` -------------------------------- ### Test .abort_not_tibblifiable error conditions Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/shape_utils.md Validates that various invalid inputs trigger the untibblifiable_object error class. ```r (expect_pkg_error_classes(.abort_not_tibblifiable(letters), "tibblify", "untibblifiable_object")) ``` ```r (expect_pkg_error_classes(.abort_not_tibblifiable(list(1, 2, 3)), "tibblify", "untibblifiable_object")) ``` ```r (expect_pkg_error_classes(.abort_not_tibblifiable(list(a = 1, a = 2)), "tibblify", "untibblifiable_object")) ``` ```r (expect_pkg_error_classes(.abort_not_tibblifiable(list(list(a = 1), letters)), "tibblify", "untibblifiable_object")) ``` -------------------------------- ### Validate tibblify spec argument Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tibblify.md Ensures that the spec argument provided to tibblify is of the correct type. ```r (expect_error(tibblify(list(), "x"))) ``` ```r (expect_error(tibblify(list(), tib_int("x")))) ``` -------------------------------- ### LTO Type Mismatch Warning Source: https://github.com/wranglezone/tibblify/blob/main/cran-comments.md A compiler warning indicating a type mismatch between a function declaration and its definition during LTO. ```c init.c:42:6: warning: type of ‘tibblify_init_utils’ does not match original declaration [-Wlto-type-mismatch] 42 | void tibblify_init_utils(SEXP ns, SEXP vctrs_ns); | ^ utils.c:123:6: note: type mismatch in parameter 2 123 | void tibblify_init_utils(SEXP ns) { | ^ utils.c:123:6: note: type ‘void’ should match type ‘struct SEXPREC *’ utils.c:123:6: note: ‘tibblify_init_utils’ was previously declared here ``` -------------------------------- ### Validate .ptype and .ptype_inner arguments Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tib_spec_basics.md Ensures that prototype arguments are valid vectors and not incompatible S3 objects. ```r (expect_error(tib_vector("x", .ptype = model))) ``` ```r (expect_error(tib_vector("x", character(), .ptype_inner = model))) ``` -------------------------------- ### Validate tib_row requirements Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tibblify.md Shows the error triggered when a required field is missing in a tib_row specification. ```r (expect_error(tibblify(list(list(x = list(a = TRUE)), list()), tspec_df(x = tib_row( "x", a = tib_lgl("a")))))) ``` -------------------------------- ### Validate untibblify input types Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/untibblify.md These snippets show validation errors when the input to untibblify is not a list. ```R (expect_error(untibblify(1:3))) ``` ```R (expect_error(untibblify(new_rational(1, 1:3)))) ``` -------------------------------- ### Define Twitter object specification Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/guess_tspec_object.md Use these functions to define the schema for nested Twitter API responses, including rows, data frames, and specific data types. ```R tib_unspecified("in_reply_to_user_id_str", .required = FALSE), tib_unspecified("in_reply_to_screen_name", .required = FALSE), tib_row( "user", .required = FALSE, tib_int("id"), tib_chr("id_str"), tib_chr("name"), tib_chr("screen_name"), tib_chr("location"), tib_chr("description"), tib_unspecified("url"), tib_df( "entities", .names_to = ".names", tib_df( "urls", tib_chr("url"), tib_chr("expanded_url"), tib_chr("display_url"), tib_int_vec("indices"), ), ), tib_lgl("protected"), tib_int("followers_count"), tib_int("friends_count"), tib_int("listed_count"), tib_chr("created_at"), tib_int("favourites_count"), tib_int("utc_offset"), tib_chr("time_zone"), tib_lgl("geo_enabled"), tib_lgl("verified"), tib_int("statuses_count"), tib_chr("lang"), tib_lgl("contributors_enabled"), tib_lgl("is_translator"), tib_lgl("is_translation_enabled"), tib_chr("profile_background_color"), tib_chr("profile_background_image_url"), tib_chr("profile_background_image_url_https"), tib_lgl("profile_background_tile"), tib_chr("profile_image_url"), tib_chr("profile_image_url_https"), tib_chr("profile_banner_url"), tib_chr("profile_link_color"), tib_chr("profile_sidebar_border_color"), tib_chr("profile_sidebar_fill_color"), tib_chr("profile_text_color"), tib_lgl("profile_use_background_image"), tib_lgl("default_profile"), tib_lgl("default_profile_image"), tib_lgl("following"), tib_lgl("follow_request_sent"), tib_lgl("notifications"), ), tib_unspecified("geo", .required = FALSE), tib_unspecified("coordinates", .required = FALSE), tib_unspecified("place", .required = FALSE), tib_unspecified("contributors", .required = FALSE), tib_int("retweet_count", .required = FALSE), tib_int("favorite_count", .required = FALSE), tib_row( "entities", .required = FALSE, tib_df( "hashtags", tib_chr("text"), tib_int_vec("indices"), ), tib_unspecified("symbols"), tib_unspecified("urls"), tib_unspecified("user_mentions"), tib_df( "media", .required = FALSE, tib_dbl("id"), tib_chr("id_str"), tib_int_vec("indices"), tib_chr("media_url"), tib_chr("media_url_https"), tib_chr("url"), tib_chr("display_url"), tib_chr("expanded_url"), tib_chr("type"), tib_df( "sizes", .names_to = ".names", tib_int("w"), tib_int("h"), tib_chr("resize"), ), ), ), tib_lgl("favorited", .required = FALSE), tib_lgl("retweeted", .required = FALSE), tib_lgl("possibly_sensitive", .required = FALSE), tib_chr("lang", .required = FALSE), ), tib_lgl("possibly_sensitive", .required = FALSE), ), tib_row( "search_metadata", tib_dbl("completed_in"), tib_dbl("max_id"), tib_chr("max_id_str"), tib_chr("next_results"), tib_chr("query"), tib_chr("refresh_url"), tib_int("count"), tib_int("since_id"), tib_chr("since_id_str"), ), ) ``` -------------------------------- ### Validate tib_variant requirements Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tibblify.md Shows the error triggered when a required field is missing in a tib_variant specification. ```r (expect_error(tibblify(list(list(x = TRUE), list(zzz = 1)), tspec_df(x = tib_variant( "x"))))) ``` -------------------------------- ### Validate scalar list parsing Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tibblify.md Covers errors related to incorrect input forms or invalid element sizes when parsing scalar lists. ```R (expect_error(tib(list(x = 1), spec))) ``` ```R (expect_error(tib(list(x = list(1, 1:2)), spec))) ``` ```R (expect_error(tib(list(x = list(integer())), spec))) ``` ```R (expect_error(tib(list(x = list(NULL, 1, 1:2)), spec))) ``` ```R (expect_error(tib(list(x = list(1, "a")), spec))) ``` -------------------------------- ### Verify guess_tspec error on invalid input Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/guess_tspec.md Ensures that an error is raised when the input provided to guess_tspec is neither a data frame nor a list. ```R expect_error(guess_tspec("a")) ``` -------------------------------- ### Test .fill coercion error Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tib_spec_basics.md Verifies that tib_scalar throws an error when the .fill argument is incompatible with the specified type. ```r (expect_error(tib_scalar("x", integer(), .fill = "a"))) ``` -------------------------------- ### Print tspec_df Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/format-tspec.md Standard printing behavior for a tspec_df object. ```R tspec_df(tib_int("id"), tib_chr("name"), tib_chr_vec("aliases")) ``` -------------------------------- ### Format non-canonical names Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/format-tspec.md Formatting tspec objects that contain non-canonical names or vector inputs. ```R format(tspec_df(b = tib_int("a"))) ``` ```R format(tspec_df(b = tib_int(c("a", "b")))) ``` -------------------------------- ### Guess Twitter JSON Specification Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/guess_tspec_object.md Uses guess_tspec_object to parse a sample Twitter JSON file and return the corresponding tibblify specification structure. ```R guess_tspec_object(read_sample_json("twitter.json")) ``` -------------------------------- ### Validate key consistency in tspec_combine Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/spec_combine.md Ensures that specifications being combined share the same keys. ```R (expect_error(tspec_combine(tspec_df(tib_int("a")), tspec_df(a = tib_int("b")))) ) ``` -------------------------------- ### Validate nest_tree parent existence Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/nest_tree.md Verifies that all parent references exist within the ID column. ```R (expect_error(nest_tree(df, id, parent, children_to = "children"))) ``` ```R (expect_error(nest_tree(df[1:2, ], id, parent, children_to = "children"))) ``` -------------------------------- ### Test tspec_combine transform incompatibility Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/spec_combine.md Verifies that tspec_combine throws an error when attempting to combine specifications with different transforms. ```R (expect_error(tspec_combine(spec_no_f, spec_f1))) ``` ```R (expect_error(tspec_combine(spec_f1, spec_f2))) ``` -------------------------------- ### Validate ptype arguments in tib_scalar Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tib_spec_basics.md Demonstrates errors triggered when the .ptype or .ptype_inner arguments receive incompatible objects like lm models. ```R (expect_error(tib_scalar("x", model))) ``` ```R (expect_error(tib_scalar("x", character(), .ptype_inner = model))) ``` -------------------------------- ### Test incompatible ptype combination Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/spec_combine.md Verifies that tspec_combine raises an error when attempting to combine integer and character ptypes. ```R (expect_error(tspec_combine(spec_int, spec_chr))) ``` -------------------------------- ### Validate tib_vector input types Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tibblify.md Shows error handling when tib_vector encounters incompatible types during conversion. ```R (expect_error(tibblify(x, tspec_df(tib_int_vec("x"))))) ``` -------------------------------- ### Validate missing field errors Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/field_to_tspec.md These tests ensure that an error is raised when attempting to access a field that does not exist in the specification. ```R (expect_error(field_to_tspec(spec, "missing"))) ``` ```R (expect_error(field_to_tspec_df(spec, "missing"))) ``` ```R (expect_error(field_to_tspec_row(spec, "missing"))) ``` ```R (expect_error(field_to_tspec_recursive(spec, "missing"))) ``` -------------------------------- ### Validate names_repair argument Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/unpack_tspec.md Checks that unpack_tspec correctly validates the names_repair argument and enforces unique naming constraints. ```R (expect_error(unpack_tspec(spec, names_repair = "minimal"))) ``` ```R (expect_error(unpack_tspec(spec, names_repair = "check_unique"))) ``` -------------------------------- ### Validate .values_to argument Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tib_spec_basics.md Ensures .values_to is a single string. ```r (expect_error(tib_vector("x", integer(), .values_to = NA))) ``` ```r (expect_error(tib_vector("x", integer(), .values_to = 1))) ``` ```r (expect_error(tib_vector("x", integer(), .values_to = c("a", "b")))) ``` -------------------------------- ### Format special ptypes Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/format-tib.md Formatting tib_scalar objects with specific inner ptypes like Date or POSIXct. ```R format(tib_scalar("a", .ptype = character(), .ptype_inner = Sys.Date())) ``` ```R format(tib_scalar("a", .ptype = character(), .ptype_inner = Sys.time())) ``` -------------------------------- ### Validate ID column constraints Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/unnest_tree.md Checks that the ID column contains unique, non-missing values to ensure proper tree structure. ```R (expect_error(unnest_tree(df_duplicated, id, children))) ``` ```R (expect_error(unnest_tree(df_na, id, children))) ``` -------------------------------- ### Validate tspec_recursive arguments Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tspec.md Ensures .children and .children_to are valid strings. ```r (expect_error(tspec_recursive(.children = 1L))) ``` ```r (expect_error(tspec_recursive(.children = "a", .children_to = 1L))) ``` -------------------------------- ### Handle detached tree parts in nest_tree Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/nest_tree.md Validates that nest_tree throws a specific tibblify-error-detached_tree_parts error when elements are not connected to a root. ```R (expect_error(nest_tree(df, id, parent, children_to = "children"), class = "tibblify-error-detached_tree_parts") ) ``` -------------------------------- ### Validate tspec_df .names_to argument Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tspec.md Ensures .names_to receives valid input types. ```r (expect_error(tspec_df(.names_to = NA_character_))) ``` ```r (expect_error(tspec_df(.names_to = 1))) ``` -------------------------------- ### Validate nest_tree type compatibility Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/nest_tree.md Ensures the parent and ID columns have compatible data types. ```R (expect_error(nest_tree(df, id, parent, children_to = "children"))) ``` -------------------------------- ### Validate tspec_combine input types Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/spec_combine.md Ensures that all arguments passed to tspec_combine are valid tibblify specs. ```R (expect_error(tspec_combine(df_spec, tib_int("a")))) ``` -------------------------------- ### Validate tspec_df .vector_allows_empty_list Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tspec.md Ensures .vector_allows_empty_list is a boolean value. ```r (expect_error(tspec_df(.vector_allows_empty_list = NA))) ``` ```r (expect_error(tspec_df(.vector_allows_empty_list = "a"))) ``` -------------------------------- ### Validate nested object names in tibblify Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tibblify.md Checks that nested objects within a list structure have valid, non-empty, and unique names. ```r (expect_error(tibblify(list(row = list(1, 2)), spec2))) ``` ```r (expect_error(tibblify(list(row = list(x = 1, 2)), spec2))) ``` ```r (expect_error(tibblify(list(row = list(1, x = 2)), spec2))) ``` ```r (expect_error(tibblify(list(row = list(z = 1, y = 2, 3, a = 4)), spec2))) ``` ```r (expect_error(tibblify(list(row = rlang::set_names(list(1, 2), c("x", NA)), spec2))) ``` ```r (expect_error(tibblify(list(row = list(x = 1, x = 2)), spec2))) ``` -------------------------------- ### Rectangle Data Automatically Source: https://github.com/wranglezone/tibblify/blob/main/README.md Convert a nested list into a tibble using the default automatic rectangling behavior. ```r tibblify(gh_users_small) ``` -------------------------------- ### Define nested columns with long names Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/data/format_breaks_long_lines.txt Use lcol_df and lcol_dbl to specify nested data structures with long column identifiers. ```R lcol_df( "path", a_long_name = lcol_dbl( "a loooooooooooooooooooog name", .fill = 1 ) ) ``` -------------------------------- ### Restrict incompatible spec combinations Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/spec_combine.md Prevents combining different categories of specifications such as df, row, and object specs. ```R (expect_error(tspec_combine(df_spec, row_spec))) ``` ```R (expect_error(tspec_combine(df_spec, obj_spec))) ``` ```R (expect_error(tspec_combine(row_spec, obj_spec))) ``` -------------------------------- ### Handle incompatible tib combinations in tspec_combine Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/spec_combine.md Triggers errors when attempting to combine incompatible tib types such as rows, scalars, vectors, or data frames. ```R (expect_error(tspec_combine(tspec_row, spec_scalar))) ``` ```R (expect_error(tspec_combine(tspec_row, spec_vec))) ``` ```R (expect_error(tspec_combine(tspec_row, tspec_df))) ``` ```R (expect_error(tspec_combine(tspec_df, spec_scalar))) ``` ```R (expect_error(tspec_combine(tspec_df, spec_vec))) ``` -------------------------------- ### Define a complex nested schema with lcols Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/data/format_lcols_complex.txt Use this structure to map deeply nested data fields, including lists and data frames, into a flat or structured tibble. Ensure all column types and parsers are correctly specified for the target data. ```R lcols( instance_id = lcol_int("instance_id"), date_added = lcol_chr("date_added"), basic_information = lcol_df( "basic_information", labels = lcol_df_lst( "labels", name = lcol_chr("name"), entity_type = lcol_chr("entity_type"), catno = lcol_chr("catno"), resource_url = lcol_chr("resource_url"), id = lcol_int("id"), entity_type_name = lcol_chr("entity_type_name") ), year = lcol_int("year"), master_url = lcol_chr("master_url", .fill = NA), artists = lcol_df_lst( "artists", join = lcol_chr("join"), name = lcol_chr("name"), anv = lcol_chr("anv"), tracks = lcol_chr("tracks"), role = lcol_chr("role"), resource_url = lcol_chr("resource_url"), id = lcol_int("id") ), id = lcol_int("id"), thumb = lcol_chr("thumb"), title = lcol_chr("title"), formats = lcol_df_lst( "formats", descriptions = lcol_lst_of( "descriptions", .ptype = character(0), .parser = ~vec_c(!!!.x, .ptype = character()), .fill = NULL ), text = lcol_chr("text", .fill = NA), name = lcol_chr("name"), qty = lcol_chr("qty") ), cover_image = lcol_chr("cover_image"), resource_url = lcol_chr("resource_url"), master_id = lcol_int("master_id") ), id = lcol_int("id"), rating = lcol_int("rating") ) ``` -------------------------------- ### Validate tspec_df .names_to with colmajor Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tspec.md Ensures .names_to is not used when .input_form is set to colmajor. ```r (expect_error(tspec_df(.names_to = "x", .input_form = "colmajor"))) ``` -------------------------------- ### Validate empty dots in tib_scalar Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tib_spec_basics.md Ensures that the tib_scalar function throws an error when unexpected arguments are passed via dots. ```R (expect_error(tib_scalar("x", logical(), TRUE))) ``` -------------------------------- ### Validate nest_tree ID constraints Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/nest_tree.md Checks that the ID column contains no missing values or duplicates. ```R (expect_error(nest_tree(df, id, parent, children_to = "children"))) ``` ```R (expect_error(nest_tree(df, id, parent, children_to = "children"))) ``` -------------------------------- ### Validate field existence in unpack_tspec Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/unpack_tspec.md Ensures that an error is thrown when attempting to unpack fields that do not exist in the specification. ```R (expect_error(unpack_tspec(spec, fields = "not-there"))) ``` ```R (expect_error(unpack_tspec(spec, fields = c("not-there", "also-not-there")))) ``` -------------------------------- ### Validate invalid spec object errors Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/field_to_tspec.md These tests confirm that an error is raised when the provided specification object is not a valid tibblify spec. ```R (expect_error(field_to_tspec(list(), "x"))) ``` ```R (expect_error(field_to_tspec_df(list(), "x"))) ``` ```R (expect_error(field_to_tspec_row(list(), "x"))) ``` ```R (expect_error(field_to_tspec_recursive(list(), "x"))) ``` -------------------------------- ### Validate tspec_df nested specifications Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tspec.md Checks for name collisions when nesting specifications. ```r (expect_error(tspec_df(spec1, spec1))) ``` -------------------------------- ### Validate fill argument in tib_scalar Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tib_spec_basics.md Checks for errors when the .fill argument has an incorrect size or incompatible type. ```R (expect_error(tib_scalar("x", integer(), .fill = integer()))) ``` ```R (expect_error(tib_scalar("x", integer(), .fill = 1:2))) ``` ```R (expect_error(tib_scalar("x", integer(), .fill = "a"))) ``` -------------------------------- ### Test error conditions for guess_tspec_object Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/guess_tspec_object.md Validates that guess_tspec_object throws appropriate errors for invalid input types or malformed lists. ```R (expect_error(guess_tspec_object(tibble(a = 1)))) ``` ```R (expect_error(guess_tspec_object(1:3))) ``` ```R (expect_error(guess_tspec_object(list(1, a = 1)))) ``` ```R (expect_error(guess_tspec_object(list(a = 1, a = 1)))) ``` -------------------------------- ### Validate tspec_df key inference Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tspec.md Checks for errors when inferring names from keys in tspec_df. ```r (expect_error(tspec_df(tib_int(c("a", "b"))))) ``` ```r (expect_error(tspec_df(y = tib_int("x"), tib_int("y")))) ``` -------------------------------- ### Validate .required argument in tib_scalar Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tib_spec_basics.md Tests for invalid inputs to the .required parameter, ensuring it receives a single logical value. ```R (expect_error(tib_scalar("x", logical(), .required = logical()))) ``` ```R (expect_error(tib_scalar("x", logical(), .required = NA))) ``` ```R (expect_error(tib_scalar("x", logical(), .required = 1L))) ``` ```R (expect_error(tib_scalar("x", logical(), .required = c(TRUE, FALSE)))) ``` -------------------------------- ### Validate child column types Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/unnest_tree.md Ensures that the children column contains valid data structures, specifically requiring lists of data frames or NULL values. ```R (expect_error(unnest_tree(df, id, children))) ``` ```R (expect_error(unnest_tree(df2, id, children))) ``` -------------------------------- ### Validate tspec_df .names_to uniqueness Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/tspec.md Ensures the column name specified by .names_to does not conflict with other columns. ```r (expect_error(tspec_df(x = tib_int("x"), .names_to = "x"))) ``` -------------------------------- ### Validate field type errors for field_to_tspec functions Source: https://github.com/wranglezone/tibblify/blob/main/tests/testthat/_snaps/field_to_tspec.md These tests verify that field extraction functions raise errors when applied to non-nested or non-recursive field types. ```R (expect_error(field_to_tspec(spec, "id"))) ``` ```R (expect_error(field_to_tspec_df(spec, "id"))) ``` ```R (expect_error(field_to_tspec_row(spec, "id"))) ``` ```R (expect_error(field_to_tspec_recursive(spec, "id"))) ``` ```R (expect_error(field_to_tspec_recursive(spec, "loc"))) ```