Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error creating a bibliometric network #491

Open
abgok opened this issue Dec 4, 2024 · 2 comments
Open

Error creating a bibliometric network #491

abgok opened this issue Dec 4, 2024 · 2 comments

Comments

@abgok
Copy link

abgok commented Dec 4, 2024

Hi Receive the following error while trying to use biblioNetwork function, can you please help?

> open_alex_data<- oa_fetch(
+   locations.source.issn = "0823-9150",
+   publication_year = 2019, 
+   verbose = TRUE
+ )
Requesting url: https://api.openalex.org/works?filter=locations.source.issn%3A0823-9150%2Cpublication_year%3A2019
Getting 1 page of results with a total of 109 records...
  converting [===============================] 100% eta:  0s
> 
> biblioNetwork(open_alex_data, 
+               analysis = "coupling", 
+               network = "countries")
[1] "Field AU_CO is not a column name of input data frame"
Error in `$<-`:
! Assigned data `gsub("DOI;", "DOI ", as.character(M$CR))` must be compatible with existing data.
✖ Existing data has 109 rows.
✖ Assigned data has 0 rows.
ℹ Only vectors of size 1 are recycled.
Caused by error in `vectbl_recycle_rhs_rows()`:
! Can't recycle input of size 0 to size 109.
Run `rlang::last_trace()` to see where the error occurred.
Warning messages:
1: Unknown or uninitialised column: `SR`. 
2: Unknown or uninitialised column: `SR`. 
3: Unknown or uninitialised column: `CR`. 
@massimoaria
Copy link
Owner

massimoaria commented Dec 9, 2024

Data downloaded from openalex are not directly usable in bibliometrix.

Bibliometrix uses a proprietary data format, so it is necessary to transform files from one of the supported DBs through the convert2df() function.

The openalexR data can be used by following the following procedure:

  1. Install the last version of bibliometrix and openalexR
install.packages("remotes")
remotes::install_github("massimoaria/bibliometrix", ref="develop")
remotes::install_github("ropensci/openalexR")

library(bibliometrix)
library(openalexR)
  1. Download data from openalex as list (argument output="list")
open_alex_data<- oa_fetch(
    locations.source.issn = "0823-9150",
    publication_year = 2019, 
    output = "list",
    verbose = TRUE
 )
  1. Save your collection in a RDATA file
save(open_alex_data, file="my_file.rdata")
  1. Convert openalex data into a Bibliometrix object
M <- convert2df(file="my_file.rdata", dbsource="openalex_api", format="api")
  1. Build a co-occurrence network
biblioNetwork(M, 
               analysis = "co-occurrences", 
               network = "author_keywords")

@abgok
Copy link
Author

abgok commented Dec 9, 2024

Many thanks for the detailed explanation, this is extremely helpful. I appreciate your help. Maybe this is something you could consider adding into the Bibliometrix/OpenAlexR documentation.

On a similar note: Open Alex is also available as a snapshot data, which can be imported into a local postgresql database. Is there a way to convert a query of this local open alex snapsot into a Bibliometrix object?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants