Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

format_error_bullets

Format bullets for error messages


Description

format_error_bullets() takes a character vector and returns a single string (or an empty vector if the input is empty). The elements of the input vector are assembled as a list of bullets, depending on their names:

  • Elements named "i" are bulleted with a blue "info" symbol.

  • Elements named "x" are bulleted with a red "cross" symbol.

  • Unnamed elements are bulleted with a "*" symbol.

This experimental infrastructure is based on the idea that sentences in error messages are best kept short and simple. From this point of view, the best way to present the information is in the cnd_body() method of an error conditon, as a bullet list of simple sentences containing a single clause. The info and cross symbols of the bullets provide hints on how to interpret the bullet relative to the general error issue, which should be supplied as cnd_header().

Usage

format_error_bullets(x)

Arguments

x

A named character vector of messages. Elements named as x or i are prefixed with the corresponding bullet.


rlang

Functions for Base Types and Core R and 'Tidyverse' Features

v0.4.11
MIT + file LICENSE
Authors
Lionel Henry [aut, cre], Hadley Wickham [aut], mikefc [cph] (Hash implementation based on Mike's xxhashlite), Yann Collet [cph] (Author of the embedded xxHash library), RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.