text() is also a function, which means that the example in the readme can easily lead to a very confusing issue:
|
```{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.
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
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:
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.