powered by
This function will fail gracefully instead of stopping the program with an error.
tryFunc(f, file)
The function to use.
The input file to be read.
The imported data frame or NULL if an error occurred.
# NOT RUN { input <- system.file("extdata", "mat.csv", package="TooManyCellsR") fail = tryFunc(read.csv, "fail.csv") fail success = tryFunc(read.csv, input) success # }
Run the code above in your browser using DataLab