Generic function to convert various data types to an sm_corpus object.
Usage
as_sm_corpus(x, ...)
# S3 method for class 'sm_corpus'
as_sm_corpus(x, ...)
# S3 method for class 'data.frame'
as_sm_corpus(x, source_label = "data.frame", ...)
# S3 method for class 'list'
as_sm_corpus(x, ...)
# S3 method for class 'bibliometrixDB'
as_sm_corpus(x, source_label = "bibliometrix-import", ...)bibliometrix data frames
as_sm_corpus() reads a data frame made by bibliometrix::convert2df()
or sm_to_bibliometrix() (class bibliometrixDB), and the file readers
with engine = "bibliometrix" use the same conversion:
worksfromTI,AB(TI_rawandAB_rawwhere present, which keep the case of the file),PY,DT,TC,LA,DIandPM;authorsandauthorshipsfromAUandAF, with one authorship row per author and address: the names in the brackets ofC1(C1rawwhere present) link authors to addresses. An address without names, as in older records, belongs to every author of the work; one whose names designate none of the authors belongs to the author of a single-author work and else to nobody. Authors are told apart by the full names ofAF; an entry whose given names are only initials, or that has noAF, belongs to the author with that surname and those initials when there is just one such author with a full name.RPgivesis_corresponding: the authors it names before "(corresponding author)" or "(reprint author)", in any case, areTRUEon all their rows and the other authors of the workFALSE. Namesakes (the same surname and initials) are told apart by the address thatRPgives with the name, and stayNAwhen it does not tell them apart; a work withoutRP, or whoseRPdesignates none of its authors for certain, getsNA(unknown);sourcesfromSO,SN,EI,J9andJI(issn_l,issn,abbreviation,iso_abbreviation);referencesfromCR, with the DOI of each item that has one;conceptsfromDE(DE_rawwhere present),ID,SCandWC, in the vocabulariesauthor-keywords, the indexer vocabulary of the source,wos-subject-categoryandwos-category.IDis read askeywords-plusfor Web of Science data (DB = "ISI"),meshfor PubMed, Dimensions, Lens and Cochrane,author-keywordsfor BibTeX and RIS files (where bibliometrix stores the keywords of the file inID) andindex-keywordsotherwise;provenancewithUTassource_id_external.
Examples
corpus <- sm_example_corpus()
as_sm_corpus(corpus)
#>
#> ── <sm_corpus> ─────────────────────────────────────────────────────────────────
#> Works: 200 | Authors: 80 | Institutions: 0
#> Years: 2015 - 2024
#> Sources (journals): 10
#> Embeddings: 200 x 64
#> Provenance: synthetic (200)
#> Status: Unlocked (last refreshed: 2026-11-22 06:02 UTC)
as_sm_corpus(corpus$works)
#>
#> ── <sm_corpus> ─────────────────────────────────────────────────────────────────
#> Works: 200 | Authors: 0 | Institutions: 0
#> Years: 2015 - 2024
#> Sources (journals): 0
#> Embeddings: none
#> Status: Unlocked (last refreshed: never)