tryFunc: Different error for importing data.

Description Usage Arguments Value Examples

View source: R/TooManyCellsR.R

Description

This function will fail gracefully instead of stopping the program with an error.

Usage

1

Arguments

f

The function to use.

file

The input file to be read.

Value

The imported data frame or NULL if an error occurred.

Examples

1
2
3
4
5
input <- system.file("extdata", "mat.csv", package="TooManyCellsR")
fail = tryFunc(read.csv, "fail.csv")
fail
success = tryFunc(read.csv, input)
success

TooManyCellsR documentation built on Oct. 8, 2019, 1:05 a.m.