cat_lines | R Documentation |
Convenience wrapper around as_chr()
and base::cat()
, mainly intended for interactive use.
cat_lines(...)
... |
R object(s) to convert to character and print. Dynamic dots are supported. |
None (invisible NULL
).
cli::cat_line()
for a faster alternative that doesn't recursively convert its input to type character.
xfun::raw_string()
(and xfun::file_string()
) for an alternative approach to the same use case (but without any conversion to type character at all).
writeLines(con = stdout())
for a base R alternative that only accepts character inputs.
fs::path_package(package = "pal",
"rstudio", "addins.dcf") |>
readr::read_lines() |>
pal::cat_lines()
# conversion to type character, recursive vs. non-recursive
to_convert <- list(tibble::tibble(a = 1:3), "A", factor("wonderful"), xfun::strict_list("day"))
to_convert |> pal::cat_lines()
to_convert |> cli::cat_line()
# this OTOH only accepts chr inputs
try(
to_convert |> writeLines()
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.