I am receiving this error
Error in stri_detect_regex(string, pattern, opts_regex = opts(pattern)) : Incorrectly nested parentheses in regexp pattern. (U_REGEX_MISMATCHED_PAREN)
when I run the code
# find occurrences of initial dataframe
named_RN$search <- map_int(named_RN$V1, function(x){sum(str_detect(final_RN$named_RN, pattern = x))})
in which named_RN$V1
looks like
aldosterone
renin
potassium
calcitrol
and final_RN$named_RN
looks like
aldosterone, creatinine
human, warfarin
aspirin, renin, calcitrol
magnesium, calcitrol
and my code aims to create a new variable within named_RN
that shows the raw counts of each phrase, so that named_RN
looks like
V1 search
aldosterone 1
renin 0
potassium 0
calcitrol 2
Please advise. Thanks.