I have this data frame I created using mergeDbSources
of Bibliometrix Package. In this dataframe there is one column named "AB_TM" created using termExtraction
. The AB_TM column consist of strings of terms (a pair of two words) seperated by semicolon ;
as seen in this Screenshot of AB_TM column.
I need to do biblioNetwork
with the "AB_TM". But before that I need to replace terms that are actually similar. For example, replacing "FINANCIAL STATEMENTS" with "FINANCIAL STATEMENT". How can I do this?
I have tried using argument synonyms
in the termExtraction
, but it seems that it only worked with extraction of Keywords (as written in the documentation of bibliometrix). I have also tried working with stringi
and stringr
package, but have not yet succeeded on doing it. All I can do is detect the target word with str_detect
but I have not yet succeeded in working with str_replace
.
Below is the code that I tried.
library(stringi)
library(stringr)
dfmerge <- "dfmerge.rda"
str_detect(dfmerge$AB_TM,
"EQUITY VALUATIONS") #this line returned properly.
str_replace_all(dfmerge$AB_TM,
"EQUITY VALUATIONS",
"EQUITY VALUATION") #this line did nothing to the AB_TM after I checked with detect
stri_replace_all_fixed(
dfmerge$AB_TM,
"EQUITY VALUATIONS",
"EQUITY VALUATION",
vectorize_all = TRUE
) #this line did nothing too to the AB_TM after I checked with detect
I hope I am conveying the question correctly as this is my first question ever in Stack.