Using either the keywords provided within theHUB or a tibble
with a collection of user defined terms and areas. The tibble
needs to
have each keyword in the keyword column and the corresponding area in the
area column.
Arguments
- data
tibble
(ordata.frame
) with the comments of interest- column.oi
string indicating the comments of interest; e.g.,
"comments.clean"
or"event.name"
- keywords.tb
tibble
with the overall group and the query- kw.group.col
keywords.tb
containing the the overall area- kw.query.col
keywords.tb
containing the queries- ignore.case
logical
ifFALSE
, the pattern matching is case sensitive and ifTRUE
, case is ignored during matching; default isFALSE
Value
tibble
(or data.frame
) with the original data plus a column
for each provided area. Each area column has a TRUE
or FALSE
for
each row indicating if the comment had a keyword present in the comment.
Details
Convert the keywords to a tibble
with a row for each area using
the following command.
keywords
A tibble: 206 x 2
keyword area
<chr> <chr>
1 adviser acadSupport
2 advising acadSupport
3 advisor acadSupport
4 assignment assessment
keywords.tb <- dplyr::group_by(keywords, area) |>
dplyr::summarise(query=paste(keyword, collapse="|"))
keywords.tb
# A tibble: 16 x 2
area query
<chr> <chr>
1 acadSupport adviser|advising|advisor
2 assessment assignment|...
Author
Emilio Xavier Esposito emilio.esposito@gmail.com (https://github.com/emilioxavier)