das_comments: Extract comments from DAS data

View source: R/das_comments.R

das_commentsR 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 das_dfr or das_df, or a data frame that can be coerced to a das_dfr object

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"))


swfscDAS documentation built on Aug. 10, 2023, 9:06 a.m.