add_image: Convert an image file name into a html path

View source: R/add_image.R

add_imageR Documentation

Convert an image file name into a html path

Description

Add images which are not auto-generated during the knitting process to all publishing formats. Images can now be saved in any format compatible with Whitehall Publisher (png or svg), and with any meaningful file name.

Usage

add_image(file_name, folder = "graphs")

Arguments

file_name

string giving the file name of the image (either png or svg)

folder

string giving the directory the image is stored in, defaults to "graphs".

Value

A plain text string which embeds the specified image into any output format

Examples

## Not run: 
##Image in default folder (graphs)
add_image("rail_usage_infographic.svg")

##Image in different folder
add_image("rail_usage_infographic.svg", folder = "img")

## End(Not run)


moj-analytical-services/mojspeakr documentation built on April 13, 2025, 9 p.m.