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"))
Run the code above in your browser using DataLab