schoolple.blogg.se

Rstudio server google cloud
Rstudio server google cloud








rstudio server google cloud rstudio server google cloud rstudio server google cloud

# write a big object to a file big_file <- "big_filename.csv" write.csv(big_object, file = big_file) # attempt upload upload_try <- gcs_upload(big_file) # if successful, upload_try is an object metadata object upload_try =Google Cloud Storage Object = Name : "big_filename.csv" Size : 8.5 Gb Media URL https : ///download /storage /v1 /b /xxxx Bucket : your -bucket ID : your -bucket / "test.pdf" /xxxx MD5 Hash : rshao1nxxxxxY68JZQ = Class : STANDARD Created : 17 : 33 : 05 Updated : 17 : 33 : 05 Generation : 1471023185977000 Meta Generation : 1 eTag : CKi90xxxx圎AE = crc32c : j4i1sQ = # if unsuccessful after 3 retries, upload_try is a Retry object =Google Cloud Storage Upload Retry Object = File Location : big_filename.csv Retry Upload URL : http : //xxxx Created : 17 : 33 : 05 Type : csv File Size : 8.5 Gb Upload Byte : 4343 Upload remaining : 8.1 Gb # you can retry to upload the remaining data using gcs_retry_upload() try2 <- gcs_retry_upload(upload_try) Library(googleCloudStorageR) # get your project name from the API console proj <- "your-project" # get bucket info buckets <- gcs_list_buckets(proj) bucket <- "your-bucket" bucket_info <- gcs_get_bucket(bucket) bucket_info =Google Cloud Storage Bucket = Bucket : your -bucket Project Number : 1123123123 Location : EU Class : STANDARD Created : 11 : 39 : 06 Updated : 11 : 39 : 06 Meta -generation : 1 eTag : Cxx = # get object info in the default bucket objects <- gcs_list_objects() # save directly to an R object (warning, don't run out of RAM if its a big object) # the download type is guessed into an appropriate R object parsed_download <- gcs_get_object(objects $name]) # if you want to do your own parsing, set parseObject to FALSE # use httr::content() to parse afterwards raw_download <- gcs_get_object(objects $name], parseObject = FALSE) # save directly to a file in your working directory # parseObject has no effect, it is a httr::content(req, "raw") download gcs_get_object(objects $name], saveToDisk = "csv_downloaded.csv")










Rstudio server google cloud