Package 'wrkshputils'

Title: Utilities for Workshops
Description: Utilties for planning and conducting virtual R workshops.
Authors: Andy Lyons [aut, cre]
Maintainer: Andy Lyons <[email protected]>
License: GPL (>= 3)
Version: 0.3.0
Built: 2026-09-19 06:37:47 UTC
Source: https://github.com/ucanr-igis/wrkshputils

Help Index


Download a file with an option to unzip

Description

Download a file with an option to unzip

Usage

wu_download(
  x,
  destdir = ".",
  auto_unzip = TRUE,
  overwrite = FALSE,
  quiet = FALSE
)

Arguments

x

A single filename or URL of a PNG or JPG image

destdir

Destination directory

auto_unzip

Automatically unzip the file, Logical

overwrite

Overwrite existing files, Logical

quiet

Suppress messages

Details

This will download a file (using download.file under the hood) with an option to unzip it (if its a zip file that is).

x must be a valid URL using http or ftp. This function requires that the URL ends in a filename (unfortunately not all URLs do).

Value

A character vector of the downloaded file. If downloading a zip file with auto_unzip = TRUE, it return a vector of filename(s) where they were unzipped.


Plot a png or jpg image file

Description

Plot a png or jpg image file

Usage

wu_popup(x, height = 360, bgcol = "#222")

Arguments

x

A filename or URL of a PNG or JPG image

height

The (minimum) height of the viewer pane

bgcol

Background color

Details

This will display a PNG or JPG image in the RStudio viewer pane. x can be either a local file or a URL. This gives you the ability to create 'popup' slides in a R script that you work through during a lesson.

height determines the minimum height in screen pixels that the viewer pane will resize itself to (if needed). Set to NULL to disable.

bgcol can be a named HTML color (e.g., gray) or a hexadecimal HTML color value (e.g., #FF0034).

Examples

## Not run: 
wu_popup("http://placekitten.com/400/300")

## End(Not run)