random_files: Randomly sample files in a directory

Description Usage Arguments Details Value Author(s) References Examples

View source: R/RandomFiles.R

Description

RandomFiles will randomly sample files from a directory and optionally its internal folders

Usage

1
2
3
4
5
6
7
random_files(
  path,
  percent_number,
  pattern = "jpg$|JPG$",
  folders = TRUE,
  results = "Q:/Waterfowl/STEI_Survey/Data/RandomFiles"
)

Arguments

path

The path to the folder containing files to be sampled (or folders of files).

percent_number

The percent (if less than 1.0) or raw number (if greater than 1.0) of files to sample.

pattern

The file extension of the requested sample.

folders

Should nested folders also be searched? TRUE/FALSE

results

The folder path for the copied (sampled) output

Details

RandomFiles was designed to randomly sample systematic photos of a sampled area for analysis. It is generalized to use any file extension a user inputs. Files are copied and a lookup table is generated to crosswalk original and new names.

Value

copies randomly selected files to results directory and writes a lookup key selected_files.csv

Author(s)

Charles Frost, charles_frost@fws.gov

References

https://github.com/cfrost3/AKaerial

Examples

1
 RandomFiles(path = "C:/DATA/PHOTOS", percent_number = 0.10, pattern = "jpg$|JPG$", folders = TRUE, results = "C:/RESULTS")

cfrost3/AKaerial documentation built on April 9, 2020, 12:50 a.m.