Skip to content

Commit

Permalink
second documentation for metadata with roxygen2
Browse files Browse the repository at this point in the history
  • Loading branch information
georgejr45 committed Jul 17, 2024
1 parent 5700f0b commit 0f66c2f
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 2 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Generated by roxygen2: do not edit by hand

export(extract.metadata)
export(read.sig)
29 changes: 29 additions & 0 deletions R/extract.metadata.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
#---------------------------------------------------------------------------------------------------------------------------#
##' Extract metadata from .sig file
##' This function reads a file generated by an instrument (default is SVC), extracts metadata, and returns it as a data frame.
##'
##' @name extract.metadata
##' @title read metadata from .sig files
##'
##' @param file A character string specifying the path to the file.
##' @param instrument A character string specifying the type of instrument. Default is "SVC".
##'
##' @return A data frame with two columns:
##' \describe{
##' \item{Key}{Character vector representing the metadata keys.}
##' \item{Value}{Character vector representing the metadata values.}
##' }
##'
##' @details
##' The function reads the content of the specified file line by line. It splits each line into key-value pairs based on the "=" delimiter and excludes lines with the key "data". The extracted key-value pairs are stored in a data frame.
##'
##' @examples
##' \dontrun{
##' metadata <- extract.metadata("/path/to/your/file.sig", instrument = "SVC")
##' print(metadata)
##' }
##'
##' @author Methun George, Steffen Neumann
##' @export


# function to extract the metadata from SVC

extract.metadata <- function(file, instrument = "SVC") {
Expand Down
2 changes: 1 addition & 1 deletion R/read.sig.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
##'
##'@export
##'
##'@author Methun George
##'@author Methun George, Steffen Neumann
##'

read.sig <- function(file_path) {
Expand Down
37 changes: 37 additions & 0 deletions man/extract.metadata.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/read.sig.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0f66c2f

Please sign in to comment.