Little useless-useful R functions – Function for faster reading with Bionic Reading

[This article was first published on R – TomazTsql, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Trick your brain into faster reading with the help of Bionic Reading. With the help of highlighting part of the words, it “guides your eyes over the text and the brain remembers previously learned words more quickly.” (source: br-about)

Here is a beautiful example of how text with the use of opacity, colours, size and many other elements can be quickly achieved for faster reading.

The vanilla output of the R language is slightly limited in terms of output in R Studio, but it can be done using some colours and text size. For the sample text, I will use the one from the image:

sample_text <- "
Bionic Reading is a new method 
facilitating the reading process
by guiding the eyes through 
text with artificial fixation points.

As a result, the reader is only 
focusing on the highlighted 
initial letters and lets the brain 
center complete the word.

In a digital world dominated 
by shallow forms of reading,
Bionic Reading aims to 
encourage a more in-depth 
reading and understanding 
of written content.

And the function is straightforward:

Make_text_easier_to_read <- function(input_text){
  bold <- "\033[1m"
  underline <- "\033[4m"
  reset <- "\033[0m"
  blue <- "\033[34m"

  modify_word <- function(word) {
    word_length <- nchar(word)
    first_half <- substr(word, 1, ceiling(word_length / 2))
    first_half_bold <- paste0(bold, first_half, reset)
    second_half <- substr(word, ceiling(word_length / 2)+1, word_length)
    second_half_bold <- paste0(blue, second_half, reset)
    final_word <- paste0(first_half_bold, second_half_bold)
    words <- unlist(strsplit(sample_text, " "))
    modified_words <- sapply(words, modify_word)
    formatted_text <- paste(modified_words, collapse = " ")
    cat(formatted_text, "\n")

For the comparison of the text, here is an example:

#simple text
cat("\033[34m", sample_text, "\033[0m", "\n")

# run the function

On the left-hand side is the normal text and on the right-hand side are the bolded parts of the words for faster reading.

As always, the complete code is available on GitHub in  Useless_R_function repository. The sample file in this repository is here (filename: Bionic_reading.R). Check the repository for future updates.

Happy R-coding and stay healthy!

Disclaimer: This blog post has not been sponsored by the owners of the product or patent. It is also not affiliated with the company. I personally like the concept and idea, and therefore, I decided to write the function. If you wish to download their product, here is the link!

To leave a comment for the author, please follow the link and comment on their blog: R – TomazTsql. offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)