read_csv_datalake: Read a CSV file stored in an AWS S3 bucket.

View source: R/datalake.R

read_csv_datalakeR Documentation

Read a CSV file stored in an AWS S3 bucket.

Description

This function get the specified object from an AWS S3 bucket and reads it using read_csv. It keeps the CSV in memory and, therefore, it avoids the unintended consequences of saving the file in the disk.

Usage

read_csv_datalake(s3_path, bucket_name = mfe_datalake_bucket,
  version = NULL, ...)

Arguments

s3_path

The filename of the desired CSV in the S3 bucket including the full path

bucket_name

Name of the bucket to connect. By default, it uses the Ministry for the Environment data lake for environmental reporting "mfedlkinput".

version

VersionId of the object key desired. Can be retrieved using get_bucket_version_df

...

Other arguments passed to the reading_function

Value

A 'tibble

Examples

## Not run: 
setup_datalake_access()
csv_object_path <- "freshwater/2020/raw/urban_stream_water_quality_state.csv"
read_csv_datalake(csv_object_path)

## End(Not run)

StatisticsNZ/er.helpers documentation built on Oct. 2, 2023, 7:24 a.m.