Append a thread counter to toots
append_thread_counter.Rd
Given a toot_df
, append a thread counter to the end of every toot. By
default, the thread counter has the format "\U1F9F5 n/N" (Unicode
character 1F9F5
is the "thread emoji"; see cat("\U1F9F5")
).
Arguments
- x
A
toot_df
as produced by a call toprep_and_check_toot_df()
, or the object produced by a call tosplit_to_toots()
, orthetoot_df
contained in such an object (in$df
).- sep
The character(s) to insert between the original toot and the thread counter.
- prefix
The prefix to insert before the thread counter.
- delim
The character(s) to insert in between the number of the current toot and the total number of toots.
- suffix
The character(s) to insert after the thread counter.
Examples
### Get example post directory
examplePostDir <-
system.file("example-post",
package = "quartodon");
### Get an example text (see the intro vignette)
exampleText <-
readLines(
file.path(examplePostDir, "quartodon.Rmd"),
encoding = "UTF-8"
);
### Extract the toots
extractedToots <- quartodon::split_to_toots(
exampleText
);
### Append the thread counters
toot_df <- quartodon::append_thread_counter(
extractedToots
);