pdap_bucket | R Documentation |
When working with PDAP, you will need to access data from either the read or write buckets. The read bucket ("S3_READ") is where PEPFAR Systems stores the MSDs and the write bucket ("S3_WRITE") is where users can upload files (USAID users will have access and write to the "usaid/" sub bucket).
pdap_bucket(type = c("read", "write"))
type |
is the bucket read (default) or write? |
When access from PDAP Posit Workbench, the function will access the system environment variables 'Sys.getenv("S3_READ")' or 'Sys.getenv("S3_WRITE")' where as it accessing locally, the user will need to store the read bucket location with 'set_key()', which securely stores this information with 'keyring' (we can only write, not read from a local machine).
character string of AWS bucket location
Other authentication:
datim_pwd()
,
datim_user()
,
get_account()
,
get_key()
,
get_keys()
,
get_s3key()
,
get_services()
,
load_secrets()
,
pano_pwd()
,
pano_user()
,
pdap_access()
,
pdap_secret()
,
set_account()
,
set_datim()
,
set_email()
,
set_key()
,
set_pano()
,
set_s3keys()
## Not run:
library(grabr)
s3_upload(upload_file_path,
bucket = pdap_bucket("write"),
prefix = "usaid/",
access_key = pdap_access(),
secret_key = pdap_secret())
#identify path to dataset uploaded
path_wrkbnch <- s3_objects(bucket = pdap_bucket("write"),
prefix = "usaid/",
access_key = pdap_access(),
secret_key = pdap_secret()) %>%
filter(str_detect(key, "Moz")) %>%
pull(key)
#read
df_msd <- s3read_using(read_psd,
bucket = pdap_bucket("write"),
object = path_wrkbnch)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.