import_sentry: "import_sentry" is an import function for Sentry Noise meter...

Description Usage Arguments Value Author(s) References Examples

View source: R/import_sentry.R

Description

Given the pathname of a file downloaded from the Sentry sound level meter, this function imports the speficied file into the R environment as a dataframe.

Usage

1
import_sentry(filename,timeformat,prefix)

Arguments

filename

The complete filename (including path, name and extension) to the file you want to import into R.

timeformat

(Optional, several default options available.) The time format in Pulsar files changes between devices and computers. The function searches for the correct format. If the correct format is not found automatically, the function will produce an error. You can then provide timeformat yourself.

prefix

(Optional, no default) Sometimes it is handy to import the column names with a prefix (e.g. "SENTRY_") so they are unique within the dataframe if you want to use the time series to compare with another instrument. The result of specifying a prefix is that all columns in the imported dataset (except for PosixTime) are named (e.g. "SENTRY_") SENTRY_LMax, SENTRY_LEQ, etc.

Value

The result is an R dataframe of your Sentry file which is ready to work with and includes the variables:

PosixTime

POSIXct, date and time of each observation.

id

character, the unique id number of the instrument used for the measurement.

LMax

Maximum sound level in dB (A-weighted).

LEQ

Equivalent continuous sound level in dB (A-weighted), also known as time average sound level or LAT.

LMin

Minimum sound level in dB (A-weighted).

Author(s)

Marloes Eeftens, marloes.eeftens@swisstph.ch

References

See the instrument producer's website for more information about the device: https://convergenceinstruments.com/pc/sound-level-meter-data-loggers/. See the following website for more information about A-weighting: http://www.acoustic-glossary.co.uk/frequency-weighting.htm.

Examples

1
2
3
4
5
6
#Write the example .csv to a folder of your choice (please change pathname!):
my_filename1<-"V:/EEH/R_functions/NOISEtools/data/sentry_example.csv"
write.table(sentry_example,file=my_filename1,sep="\t",quote=FALSE,row.names=FALSE)
#Import using the import function:
my_sentry_file<-import_sentry(filename=my_filename1,prefix="SENTRY_")
str(my_sentry_file)

MarloesEeftens/NOISEtools documentation built on Dec. 14, 2019, 5:54 p.m.