Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File access in R #174

Open
riccile opened this issue Aug 26, 2020 · 10 comments
Open

File access in R #174

riccile opened this issue Aug 26, 2020 · 10 comments

Comments

@riccile
Copy link

riccile commented Aug 26, 2020

Hi, I was wondering if it is possible to access files in R without downloading them locally. I have a large photo database stored on Box and I'm trying to extract detailed metadata from the photos. Is there a way I could direct a function to read file metadata directly from box? Thanks!

@ijlyttle
Copy link
Member

Although it works on a directory basis, would box_ls() return the information you are looking for?

@nathancday
Copy link
Member

What R tools/function do you use to read meta-data from these files locally? (I know nothing about photo meta info)

@ijlyttle
Copy link
Member

Putting this here for later reference: https://support.box.com/hc/en-us/articles/360044196173-Using-Metadata

@laurenricci: It looks like there is a way to get to metadata; I'd want to make sure that the metadata you are looking for is being stored on Box, before we start "digging".

@danielruss
Copy link

danielruss commented May 21, 2021

I was looking into this also. One problem is that the internal function boxGet forcibly sets download to TRUE, we have no way to set this to true and since boxGet is not exported, we cannot call it directly.

Although, I'm not interested in meta data, just the file.

@nathancday
Copy link
Member

nathancday commented May 22, 2021

you can use a triple colon to access internal package functions, boxr:::boxGet(..., download=F)

@danielruss
Copy link

danielruss commented May 24, 2021

@nathancday Thank you. I've been using R for over 10 years and never came across the triple colon syntax. However in the docs:

Note
It is typically a design mistake to use ::: in your code since the corresponding object has probably been kept internal for a good reason. Consider contacting the package maintainer if you feel the need to access the object for anything but mere inspection.

@nathancday
Copy link
Member

what docs?

@danielruss
Copy link

danielruss commented May 24, 2021

?`::`

@nathancday
Copy link
Member

nathancday commented May 24, 2021

ahh I see it in base R now. I wouldn't import internal functions into another package, but you could work with for a POC or if you already have boxr in your environment.
https://stat.ethz.ch/R-manual/R-devel/library/base/html/ns-dblcolon.html

@danielruss
Copy link

I'm hoping to provide a PR back to boxr anyway. I would love to add a boxr::box_stream(fid,callback,...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants