swfscDAS (version 0.4.0)

das_comments: Extract comments from DAS data

Description

Extract comments from DAS data

Usage

das_comments(x)

# S3 method for data.frame das_comments(x)

# S3 method for das_df das_comments(x)

# S3 method for das_dfr das_comments(x)

Arguments

x

an object of class das_dfr or das_df, or a data frame that can be coerced to a das_dfr object

Value

x, filtered for C events and with the added column comment_str containing the concatenated comment strings

Details

This function recreates the comment strings by pasting the Data# columns back together for the C events (comments). See the examples section for how to search for comments with certain phrases

Examples

Run this code
# NOT RUN {
y <- system.file("das_sample.das", package = "swfscDAS")
y.proc <- das_process(y)

das_comments(y.proc)

# Extract all comments containing "record" - could also use stringr pacakge
y.comm <- das_comments(y.proc)
y.comm[grepl("record", y.comm$comment_str, ignore.case = TRUE), ]

# Join comments with processed data
dplyr::left_join(y.proc, y.comm[, c("file_das", "line_num", "comment_str")],
                 by = c("file_das", "line_num"))

# }

Run the code above in your browser using DataLab