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 <nickmw...@gmail.com <mailto:nickmw...@gmail.com>>
To: r-help@r-project.org <mailto:r-help@r-project.org>
Subject: [R] Listing folders on One Drive
Message-ID:
<CABxY9BM35aW7Np7kkVybAZm_HN8_5uZ0x017b1Wq5=ds4we...@mail.gmail.com 
<mailto:ds4we...@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]]





______________________________________________
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