das_comments {swfscDAS} | R Documentation |
Extract comments from DAS data
Description
Extract comments from DAS data
Usage
das_comments(x)
## S3 method for class 'data.frame'
das_comments(x)
## S3 method for class 'das_df'
das_comments(x)
## S3 method for class 'das_dfr'
das_comments(x)
Arguments
x |
an object of class |
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
Value
x
, filtered for C events and with the added column
comment_str containing the concatenated comment strings
Examples
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"))
[Package swfscDAS version 0.6.3 Index]