Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete basic vignette #87

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions R/extract_metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ get_basic_metadata <- function(ds_list) {

get_meta_timestamp <- function(ds_list) {
text <- ds_list$history$text
history <- paste0(text, collapse = "")
history <- paste0(text, collapse = "")
save_file_time <- gsub(".*Save File\t\t(\\d.*)\t\t\t.*", "\\1", history)

time_hour_tz <- strsplit(x = save_file_time, split = " ")[[1L]]
Expand All @@ -41,7 +41,7 @@ get_meta_timestamp <- function(ds_list) {
get_meta_utc_datetime <- function(timestamp) {
tz <- timestamp$timezone
utc_diff <- as.integer(gsub("\\D+(\\+\\d)", "\\1", tz))
utc_datetime <- as.POSIXct(strptime(timestamp$datetime,
utc_datetime <- as.POSIXct(strptime(timestamp$datetime,
format = "%Y-%m-%d %H:%M:%S",
tz = "UTC"
)) - (utc_diff * 3600)
Expand Down
6 changes: 3 additions & 3 deletions vignettes/introduction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Bruker instruments produce a proprietary file format when measuring spectra, cal
parameters, configurations, environmental conditions, for different spectral data types within OPUS binary files.

Our package can read those binary files for most of the
Fourier-Transform(FT)-Infrared(IR)-spectrometers from Bruker Optics GmBH.
Fourier-Transform(FT)-Infrared(IR)-spectrometers from Bruker Optics GmbH. We further aim to extend support for devices.

# Reading OPUS files

Expand All @@ -35,7 +35,7 @@ file <- opus_file()
data_list <- read_opus(dsn = file)
```

Thereby, `dsn` is the data source name, that currently either be a character vector of the folder path to read files from, or characters of OPUS file paths.
The argument `dsn` stands for 'data source name'. This is currently either a character vector of a single folder path to read files from recursively, or characters of OPUS file paths.


`read_opus()` parses into an R list (S3) of class "list_opusreader2". The data is arranged
Expand All @@ -50,4 +50,4 @@ For single OPUS files, there is also a lower level implementation.

```r
data_single <- read_opus_single(dsn = file)
```
```