massimoaria / pubmedR

Gathering metadata about publications, patents, grants, clinical trials and policy documents from PubMed database
Other
36 stars 13 forks source link

Report error when I run the example. #3

Open LhlStat opened 4 years ago

LhlStat commented 4 years ago

I ran the example on Rstudio windows. And the when I ran "M <- pmApi2df(D)" , it reported error "in FUN(X[[i]], ...) : invalid multibyte string 95".

Could you please help me out? Thanks a lot!

zxy126 commented 4 years ago

I meet the problem and going to open a new issue too.

Thank massimoaria for the excellent R package bibliometrix, but like the LhlStat said, sometimes I download data from the Pubmed by pubmedR and try to convert the data to the data frame, it shows "invalid multibyte string XXX".

I found that there is something wrong in the D$data$PubmedArticle$MedlineCitation$Article$Abstract$AbstractText

e.g., the abstract in the pubmed is "evolved E. coli TadA (TadA∗) and", but the $data...$AbstractText show "evolved E.聽coli TadA (TadA鈭<97>) and" the pubmed link

e.g., the abstract in the pubmed is "filamentous fungus Aspergillus terreus. However, the difficulties", but the $data...$AbstractText is ' "filamentous fungus "

$i [1] "Aspergillus terreus"

$text [1] ". However, ' the pubmed link

If I fix the AbstractText manually it converts to the data frame successfully. But I don't know how to deal with it in the program. Besides, I try to introduce the bibliometrix to some of my friends(non-coder), but I found that is no api_key input box in GUI. If you can add an input box that would be nice for the non-coder.

Medical students heavily rely on PubMed and many will be benefited from bibliometrix. Thanks a lot! XD

The error error

The e.g. 1 eg1

The e.g. 2 eg2

massimoaria commented 4 years ago

Unfortunately, your problem is not relative to the package codes. The issue "invalid multibyte string" is due to a not standard character set used by the PC running Rstudio. To work well, the imported files have to follow the UTF-8 standard.

In fact, I am not able to replicate the issue on my PC because I use a standard character set UTF-8.

Some Chinese scholars, for example, solved the issue using the following code in R: Sys.setlocale("LC_ALL", "C")

Please, try to do that.

zxy126 commented 4 years ago

Unfortunately, your problem is not relative to the package codes. The issue "invalid multibyte string" is due to a not standard character set used by the PC running Rstudio. To work well, the imported files have to follow the UTF-8 standard.

In fact, I am not able to replicate the issue on my PC because I use a standard character set UTF-8.

Some Chinese scholars, for example, solved the issue using the following code in R: Sys.setlocale("LC_ALL", "C")

Please, try to do that.

Thanks, it works for me!