Skip to contents

Check if target data config file exists in hub

Usage

has_target_data_config(hub_path)

# Default S3 method
has_target_data_config(hub_path)

# S3 method for class 'SubTreeFileSystem'
has_target_data_config(hub_path)

Arguments

hub_path

Either a character string path to a local Modeling Hub directory, a character string of a URL to a GitHub repository or an object of class <SubTreeFileSystem> created using functions arrow::s3_bucket() or arrow::gs_bucket() by providing a string S3 or GCS bucket name or path to a Modeling Hub directory stored in the cloud. For more details consult the Using cloud storage (S3, GCS) in the arrow package.

Value

Logical. TRUE if the target-data.json file exists in the hub-config directory of the hub, FALSE otherwise.

Examples

config_hub <- system.file("testhubs/v6/target_file/", package = "hubUtils")
has_target_data_config(config_hub)
#> /home/runner/work/_temp/Library/hubUtils/testhubs/v6/target_file/hub-config/target-data.json 
#>                                                                                         TRUE 

no_config_hub <- system.file("testhubs/v5/target_file/", package = "hubUtils")
has_target_data_config(no_config_hub)
#> /home/runner/work/_temp/Library/hubUtils/testhubs/v5/target_file/hub-config/target-data.json 
#>                                                                                        FALSE