[R] Listing folders on One Drive

Jorgen Harmse JH@rm@e @end|ng |rom roku@com
Tue May 21 17:27:53 CEST 2024


I would just use
fi <- file.info(dir(path, recursive=TRUE, include.dirs=TRUE))
path could be the OneDrive directory or Scotland (and is not needed if you're already in the directory you want).
Then rownames(subset(fi, isdir)) will contain all the directories. Maybe you want to use grep or other machinery to thin it out.

Regards,
Jorgen Harmse.

----------------------------------------------------------------------


Message: 1
Date: Mon, 20 May 2024 14:36:58 +0100
From: Nick Wray <nickmwray using gmail.com <mailto:nickmwray using gmail.com>>
To: r-help using r-project.org <mailto:r-help using r-project.org>
Subject: [R] Listing folders on One Drive
Message-ID:
<CABxY9BM35aW7Np7kkVybAZm_HN8_5uZ0x017b1Wq5=dS4wEN2g using mail.gmail.com <mailto:dS4wEN2g using mail.gmail.com>>
Content-Type: text/plain; charset="utf-8"


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]]







More information about the R-help mailing list