Skip to content

Not ideal that the text column in mini_sotu_par is called text #4

Description

@JBGruber

text() is also a function, which means that the example in the readme can easily lead to a very confusing issue:

annotinder-r/README.Rmd

Lines 46 to 51 in b56d5f5

```{r}
units <- create_units(mini_sotu_par,
id = "id",
set_text("text", text)
)
```

If this was copied and used on different data, users don't get an error, but confusingly the unit values now contain a function definition:

library(annotinder)
df <- data.frame(id = 1:10, full_text = LETTERS[1:10])

units <- create_units(df, 
             id = "id", 
             set_text("text", text) 
) 
units[[1]][["unit"]][["text_fields"]][[1]][["value"]]
#> function (x, ...) 
#> UseMethod("text")
#> <bytecode: 0x5db8cd0b24c8>
#> <environment: namespace:graphics>

Created on 2025-03-20 with reprex v2.1.1

Either the server then does not start up properly or the displayed text is the function definition, which is equally confusing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions