Learn R Programming

emuR (version 2.4.0)

add_files: Add files to emuDB

Description

Add files to existing bundles of specified session of emuDB. Do not use this function to import new recordings (media files) and create bundles; see ?import_mediaFiles to import new recordings. The files that are found in dir that have the extension fileExtension will be copied into the according bundle folder that have the same basename as the file. Note that the same bundle name may appear in different sessions, therefore you must specify the session in targetSessionName. For more information on the structural elements of an emuDB see vignette{emuDB}. Note that adding files does not mean the emuDB is automatically using these, unless you have defined the usage of these files (e.g. by ssffTrackDefinitions).

Usage

add_files(emuDBhandle, dir, fileExtension, targetSessionName = "0000")

Arguments

emuDBhandle

emuDB handle as returned by load_emuDB

dir

directory containing files to be added

fileExtension

file extension of files to be added. If no . (dot) is found in this string (e.g. "zcr") then the bundle name matching is performed by removing paste0(".", fileExtension) from the files ("/path/to/msajc003.zcr" will become "msajc003") and the according bundle name will be searched. If a . (dot) if found within this string (e.g. "_annot.json") then the entire string is remove without prepending a . (dot) ("/path/to/msajc003_annot.json" will then become "msajc003")

targetSessionName

name of sessions containing bundles that the files will be added to

Examples

Run this code
if (FALSE) {

##################################
# prerequisite: loaded ae emuDB 
# (see ?load_emuDB for more information)

# specify path to folder containing the following
# files we wish to add to: 
# msajc003.zcr, msajc010.zcr, msajc012.zcr, msajc015.zcr, 
# msajc022.zcr, msajc023.zcr and msajc057.zcr 
path2dir = "/path/to/dir/"

# add the files to session "0000" of the "ae" emuDB
add_files(emuDBhandle = ae,
          dir = path2dir,
          fileExtension = "zcr",
          targetSessionName = "0000")

}

Run the code above in your browser using DataLab