Adds new lines to the description so that hover boxes don't get too wide.

newlines_to_definition(definition, line_length = 10)

Arguments

definition

A disease description string

line_length

A integer representing the desired words per line.

Value

The disease description with newline symbols added every nth word.

Examples

description <- "A dialeptic seizure is a type of seizure characterised
predominantly by reduced responsiveness or awareness and with subsequent at
least partial amnesia of the event."
newlines_to_definition(description, 10)
#> [1] "A dialeptic seizure is a type of seizure characterised\npredominantly \nby reduced responsiveness or awareness and with subsequent at\nleast partial \namnesia of the event."