Registered users can ask their own questions, contribute to discussions, and be part of the Community!
I want to save a data object from an R notebook in a managed folder on DSS so it can be read by a Jupyter notebook.
I am using
# data must be a connection providing the data to uploaddata = c(0,1.1,2.2,3.3)
dkuManagedFolderUploadPath("folder_name", "path_in_folder", data)
To upload the data but I am getting the following error:
Error in readBin(arr, double(), 6, size = 4): can only read from a binary connection
1. readBin(arr, double(), 6, size = 4)
How can I solve this readBin error?
Operating system used: Windows
Hi @nadine ,
dkuManagedFolderUploadPath expects a connection object, not a vector. You'll need to save your data object to a temporary file first:
# Save `data` to a managed folder
data = c(0,1.1,2.2,3.3)
temp_filename <- tempfile("r-managed-folder-")
temp_connection <- file(temp_filename, "rb")
dkuManagedFolderUploadPath("folder_name", "path_in_folder", temp_connection)
You can then load the data object using the following code:
# Load `data` from a managed folder
raw_data <- dkuManagedFolderDownloadPath("folder_name", "path_in_folder", as="raw")
temp_filename <- tempfile(pattern="r-managed-folder-")
Post a Question