Created
December 22, 2018 17:26
-
-
Save erikgregorywebb/66d617a8068bd35d6fdbe8d3e702a90e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# count the number of files and folders | |
years <- c('2010', '2011', '2012', '2013', '2014', '2015', '2016', '2017', '2018') | |
directory <- '/Users/erikgregorywebb/Documents/Python/runtwolf/R/' | |
for (i in 1:length(years)) { | |
file_count = 0 | |
setwd(paste(directory, years[i], '/XC', sep = "")) | |
folders <- list.files() | |
for (j in 1:length(folders)) { | |
setwd(paste(directory, years[i], '/XC/', folders[j], sep = "")) | |
files <- list.files() | |
file_count = file_count + length(files) | |
} | |
print(paste(years[i], file_count, length(folders), sep = " ")) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment