Skip to contents

This function checks if a given file is a valid RData file by verifying its extension and attempting to load it. It uses the LoadAs to load the file. If the file loads successfully and the object exists, it returns TRUE. If the file cannot be loaded or the object does not exist, it returns FALSE.

Usage

CheckRData(File, warning = TRUE)

Arguments

File

character. The file path of the file to be checked. This can not be empty.

warning

logical. If TRUE (default), warnings will be printed if the file does not exist.

Value

A logical value indicating if the file is a valid RData file

Author

Ahmed El-Gabbas