| codebook_diff | R Documentation |
Create a compact diff of two foundry_codebook objects, including both
hashes, a unified diff of instructions, and field-level changes for schema
properties and examples. Assign the result to inspect it without console
output, or print it to display the diff.
codebook_diff(old, new)
## S3 method for class 'foundry_codebook_diff'
format(x, ...)
## S3 method for class 'foundry_codebook_diff'
print(x, ...)
old, new |
|
x |
A |
... |
Unused. |
codebook_diff() returns a character vector of diff lines with class
foundry_codebook_diff. format() returns the plain character vector.
print() displays the lines and invisibly returns x.
old <- foundry_codebook(
name = "support-sentiment",
version = "1.0.0",
instructions = "Label the sentiment of support tickets.",
schema = foundry_schema(sentiment = type_enum(values = c("pos", "neg")))
)
new <- foundry_codebook(
name = "support-sentiment",
version = "1.1.0",
instructions = "Label the sentiment and urgency of support tickets.",
schema = foundry_schema(
sentiment = type_enum(values = c("pos", "neg")),
urgent = type_boolean()
)
)
diff <- codebook_diff(old, new)
print(diff)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.