View source: R/airdas_comments.R
| airdas_comments | R Documentation |
Extract comments from airdas_dfr or airdas_df object
airdas_comments(x)
## S3 method for class 'data.frame'
airdas_comments(x)
## S3 method for class 'airdas_df'
airdas_comments(x)
## S3 method for class 'airdas_dfr'
airdas_comments(x)
x |
|
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 the phrase "record" to determine what extra information (e.g. molas) was being recorded vs ignored.
x, filtered for C events and with the added column
comment_str containing the concatenated comment strings
y <- system.file("airdas_sample.das", package = "swfscAirDAS")
y.read <- airdas_read(y, file.type = "turtle")
airdas_comments(y.read)
# Extract all comments containing "record"
y.comm <- airdas_comments(y.read)
y.comm[grepl("record", y.comm$comment_str, ignore.case = TRUE), ]
# Extract all comments containing "record", but not "recorder"
y.comm <- airdas_comments(y.read)
y.comm[grepl("record", y.comm$comment_str, ignore.case = TRUE) &
!grepl("recorder", y.comm$comment_str, ignore.case = TRUE), ]
# Join comments with processed data
dplyr::left_join(y.read, y.comm[, c("file_das", "line_num", "comment_str")],
by = c("file_das", "line_num"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.