Skip to content

Commit

Permalink
Remove unneeded information from looping over files
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanwhite committed Nov 4, 2022
1 parent 820b9a8 commit b0ca28b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions materials/for-loops-R.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,10 @@ list.files()
```

* But we just want the data files so we'll add the optional `pattern` argument to only get the files that start with `"locations-"`
* The `*` is a wild card, so this means "starts with locations- and includes anything afterwards"


```r
data_files = list.files(pattern = "locations-*",
full.names = TRUE)
data_files = list.files(pattern = "locations-")
```

* Once we have this list we can loop over it count the number of observations in each file
Expand Down

0 comments on commit b0ca28b

Please sign in to comment.