user2654764
user2654764

Reputation: 1829

How do I count the number of files read into this list?

I have a bunch of csv files that I am reading into a list like this:

f <- list.files(pattern="201\\d{5}\\.csv")

Is there any way to count how many files that I am reading in?

Upvotes: 4

Views: 9343

Answers (1)

NPE
NPE

Reputation: 500693

Yes, length(f) will give you the number of file names in f.

Upvotes: 6

Related Questions