0

I'm working with the bibliometrix package, functions cocMatrix and biblioNetwork.

I read my data, M from an Excel spreadsheet:

M <- readxl::read_xlsx("prueba.xlsx")

Here is a sample:

structure(list(AU = c("CALIXTO-FLORES R", "TINOCO-IZQUIERDO W; GUAMÁN-GÓMEZ V; BUSTOS-OCHOA F; VÉLEZ-TORRES E", "RAMÍREZ-SÁNCHEZ N; DÍAZ-MURILLO MP; REYES-HARKER P; CUECA-GONZÁLEZ O", "MORENO-FERNÁNDEZ O; GARCÍA-PÉREZ F", "POLLÉ-TERTULIÉN M; CHÁVEZ-HERNÁNDEZ S; SORIS-LÓPEZ T") 
str(M$AU)
#chr [1:5] "CALIXTO-FLORES R" ...

Here is my code:

A <- cocMatrix(M, "AU", sep = ";")
NetMatrix <- biblioNetwork(M, analysis = "collaboration", network = "countries", sep = ";")

In both cases I have the next problem:

Error in strsplit(M[, Field], sep) : non-character argument

I tried to solve the error with the following code:

M$AU <- as.character(M$AU)

But it doesn't work. How can I fix the error?

Ian Campbell
  • 23,484
  • 14
  • 36
  • 57
  • What does M actually look like? Can you show a small sample using `dput` or `str`? – Edward Jul 10 '20 at 02:04
  • Sure! If I dput variable AU: structure(list(AU = c("CALIXTO-FLORES R", "TINOCO-IZQUIERDO W; GUAMÁN-GÓMEZ V; BUSTOS-OCHOA F; VÉLEZ-TORRES E", "RAMÍREZ-SÁNCHEZ N; DÍAZ-MURILLO MP; REYES-HARKER P; CUECA-GONZÁLEZ O", "MORENO-FERNÁNDEZ O; GARCÍA-PÉREZ F", "POLLÉ-TERTULIÉN M; CHÁVEZ-HERNÁNDEZ S; SORIS-LÓPEZ T" ) – user13902642 Jul 10 '20 at 02:46
  • It shouldn't be a list. It has to be a character vector. You'll have to show the R command to create `M`. Edit your question, not as a comment. – Edward Jul 10 '20 at 03:04

1 Answers1

0

Solution:

NetMatrix <- biblioNetwork(data.frame(M), analysis = "collaboration",
                           network = "countries", sep = ";")

It worked for me.

Ian Campbell
  • 23,484
  • 14
  • 36
  • 57