winopen: Function to open a file or directory

View source: R/winopen.R

winopenR Documentation

Function to open a file or directory

Description

This function will open the target path, x, with it's associated application, or with Windows Explorer if x is a directory

Usage

winopen(x)

Arguments

x

A folder or file to be opened.

Details

If the file or directory does not exist it will open the first parent directory that does exists.

Value

This function is primarily called for the side effect of opening a file or directory It invisibly returns a normalized path to the item it opened, which is either x or a parent directory that exists on disk.

Examples

## Not run: 

# Open the R directory
winopen("C:/Program Files/R/")

# Plot to a file and then open the file
f <- tempfile(fileext = ".png")
png(f)
plot(1, 1)
dev.off()
winopen(f)

## End(Not run)

ethanplunkett/slasher documentation built on Sept. 27, 2022, 3:37 p.m.