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

a feature request - make it possible to convert a handlr object to a data frame #15

Closed
GeraldCNelson opened this issue Mar 1, 2019 · 5 comments
Milestone

Comments

@GeraldCNelson
Copy link

I'd like to request a function to convert a handl object into a data frame. There are times when I'd would like to be able to scan through a large set of references. Or pull out a column like the DOIs. Thanks for considering this!

@sckott
Copy link
Contributor

sckott commented Mar 1, 2019

thanks for this @GeraldCNelson

just to make sure we're on the same page, you are referring only to the handl object, and not to other outputs?

@GeraldCNelson
Copy link
Author

Scott, I'm not sure I understand the details of the package well enough to give you a definitive answer. Here's my situation. I'm one of the lead authors on an IPCC chapter for AR6. We are supposed to assess the literature on climate change and topic x, where x is food security in my case. I have published a fair amount in my particular area of expertise. But I can't claim to know all the literature. So the process we're going through is to use various reference data bases - SCOPUS and Web of Science in particular, and then do so classification, both automatically (e.g., citation count > 3 and language = English,French). SCOPUS has a cvs output that lets us do the filtering but I can't figure out if WoS does. However both do .ris and .bib files. So I can read in these. Here's an example
temp <- ris_reader(x = "~/Downloads/consumption_14.ris")

consumption_14.ris is a 2.6 MB .ris file.
temp is an 840 Mb handl object. It looks like basically a list for each reference with each list having the same components.
I have attached a zipped csv file that comes out from SCOPUS. What I'm looking for is a way to convert .ris or .bib files to this type of csv file. I'm guessing that the handlr object can be converted to a data frame or table that could then be saved to a csv (or other) file format.
financialization.csv.zip

@sckott
Copy link
Contributor

sckott commented Mar 4, 2019

Thanks for the clarifications @GeraldCNelson It helps to know what the use case is.

I'll have a look and get back to you soon

@sckott sckott added this to the v0.2 milestone Mar 4, 2019
sckott added a commit that referenced this issue Mar 5, 2019
@sckott
Copy link
Contributor

sckott commented Mar 5, 2019

@GeraldCNelson after reinstalling remotes::install_github("ropensci/handlr@handl-to-df"), reload R, and try examples:

library(handlr)
z <- system.file('extdata/crossref.ris', package = "handlr")
x <- HandlrClient$new(x = z)
x$as_df() # empty data.frame
x$read()
x$as_df() # data.frame with citation data

# one citation
z <- system.file('extdata/crossref.ris', package = "handlr")
res <- ris_reader(z)
handl_to_df(res)

# many citations
z <- system.file('extdata/bib-many.bib', package = "handlr")
res2 <- bibtex_reader(x = z)
handl_to_df(res2)

sckott added a commit that referenced this issue Aug 16, 2019
@sckott
Copy link
Contributor

sckott commented Aug 16, 2019

fixed #19

@sckott sckott closed this as completed Aug 16, 2019
This issue was closed.
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