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]]
What does "doesn't work" mean? What have you tried? On May 20, 2024 6:36:58 AM PDT, Nick Wray <nickmwray at gmail.com> wrote:>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 at 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.-- Sent from my phone. Please excuse my brevity.
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-bounces at r-project.org> On Behalf Of Nick Wray Sent: Monday, May 20, 2024 9:37 AM To: r-help at 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 at 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.
Dear Nick, See list.dirs(), which is documented in the same help file as list.files(). I hope this helps, John -- John Fox, Professor Emeritus McMaster University Hamilton, Ontario, Canada web: https://www.john-fox.ca/ -- On 2024-05-20 9:36 a.m., Nick Wray wrote:> [You don't often get email from nickmwray at gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] > > Caution: External email. > > > 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 at 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.