s3_path_to_full_df: Read a full file from S3, using the full path to the file...

View source: R/read.R

s3_path_to_full_dfR Documentation

Read a full file from S3, using the full path to the file including the bucketname.

Description

This function will attempt to read the file directly, as a dataframe. If this is not possible it will download the file to a temporary location and load it. At present the function supports direct reading of CSV, TSV, XLS, XLSX, SAS7DBAT, SAV and DTA file types. You can add options to the read function that are compatible with readxl::read_excel() and read.csv(). See their help files for more info.

Usage

s3_path_to_full_df(s3_path, ...)

Arguments

path

a string - the full path to the file including the bucketname

Value

a dataframe (.csv, .tsv), tibble (Excel, SAS, SPSS, Stata), or file location

Examples

df <- s3_read_path_to_df("alpha-moj-analytics-scratch/folder/file.csv")
df <- s3_read_path_to_df("alpha-moj-analytics-scratch/folder/file.tsv")
df <- s3_read_path_to_df("alpha-moj-analytics-scratch/folder/file.xls")
df <- s3_read_path_to_df("alpha-moj-analytics-scratch/folder/file.xls", sheet = 1)
filelocation <- s3_read_path_to_df("alpha-moj-analytics-scratch/folder/file.png")

moj-analytical-services/Rs3tools documentation built on Aug. 9, 2024, 1:27 a.m.