Learn R Programming

locaR (version 0.1.2)

getFilepaths: Get filepath information for a date and time.

Description

getFilepaths reads information from a settings file (csv) or a settings list and returns the file paths and other information as a dataframe. It undertakes a recursive search within the site folder for files matching the date and time.

Usage

getFilepaths(settings, types = "wav")

Value

A data frame with station names, coordinates, filepaths, and any recording start-time adjustments.

Arguments

settings

Either a filepath to a settings file (csv) or a settings list. If a filepath, the filepath will first be passed to processSettings.

types

Character, specifying the file type to be searched for. Either 'wav' or 'mp3'.

Examples

Run this code
    #Read example data
    settings <- read.csv(system.file('extdata',
                   'Ex_20200617_090000_Settings.csv', package = 'locaR'),
                   stringsAsFactors = FALSE)

    #Over-write default values for SiteWavsFolder, CoordinatesFile, and ChannelsFile
    settings$Value[settings$Setting == 'SiteWavsFolder'] <-
                  system.file('extdata', package = 'locaR')
    settings$Value[settings$Setting == 'CoordinatesFile'] <-
                   system.file('extdata', 'Vignette_Coordinates.csv',
                               package = 'locaR')
    settings$Value[settings$Setting == 'ChannelsFile'] <-
                   system.file('extdata', 'Vignette_Channels.csv',
                               package = 'locaR')

    #Run processSettings() function
    st <- processSettings(settings = settings, getFilepaths = FALSE)

    #Get filepaths.
    fp <- getFilepaths(settings = st, types = 'mp3')

Run the code above in your browser using DataLab