Nick,

As Jeff said, we don't know what you tried and what did not work.

There are built-in and probably package versions but have you tried
something like list.files()?

You can tweak it to get the files you want by doing something like:

-change directory to HERE
- here.files <- list.files(recursive=TRUE)
- change directory to THERE
- here.files <- list.files(recursive=TRUE)

Now compare what you have in the two places. There are many ways but if all
the files in or, if recursive, deeper, are the same, you have them all. Of
course this does not test to see if the files are identical. Or you could
use sorting and comparing to see if you can isolate what is missing, or use
set operations that test for intersection or something like"

Missing <- setdiff(here.files, there.files)

And in that case, also test the reverse.

The function setequal() test for equality but won't tell you what is
missing.

Obviously, if your method generates full, not relative file names, you could
process the names to remove a fixed prefix.

-----Original Message-----
From: R-help <r-help-boun...@r-project.org> On Behalf Of Nick Wray
Sent: Monday, May 20, 2024 9:37 AM
To: r-help@r-project.org
Subject: [R] Listing folders on One Drive

Hello I have lots of folders of individual Scottish river catchments on my
uni One Drive.  Each folder is labelled with the river name eg "Tay" and
they are all in a folder named "Scotland"
I want to list the folders on One Drive so that I can cross check that I
have them all against a list of folders on my laptop.
Can I somehow use list.files() - I've tried various things but none seem to
work...
Any help appreciated
Thanks Nick Wray

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to