Skip to content

new function write_qsf(), closes #299, #302#319

Open
jmobrien wants to merge 1 commit intomainfrom
qsf2
Open

new function write_qsf(), closes #299, #302#319
jmobrien wants to merge 1 commit intomainfrom
qsf2

Conversation

@jmobrien
Copy link
Copy Markdown
Collaborator

No description provided.

@juliasilge
Copy link
Copy Markdown
Collaborator

It looks like this is ready for me to try it out, review, merge, etc. Is that right @jmobrien?

@jmobrien
Copy link
Copy Markdown
Collaborator Author

Yep. Should be ready to go as long as you agree.

Copy link
Copy Markdown
Collaborator

@juliasilge juliasilge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great! 🙌 I've got just a couple of thoughts for changes.

Comment thread R/fetch_description.R
Comment on lines +205 to +206
file = NULL,
save = TRUE
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we've got a little bit of interacting arguments here between file and save. I think the best option is to make file = NULL do the same thing as the current save = FALSE. That means the default behavior (with file = NULL) would be to return the JSON content but not save it, but if someone provides a file then it will save it.

Comment thread R/fetch_description.R
#' default), or returned as output (\code{FALSE})? Even when \code{TRUE},
#' downloaded JSON is returned invisibly.
#'
#'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add an example? It would be a nice way to re-emphasize how to save as a file vs. only return the content. It will likely need to be wrapped so it doesn't execute like basically all our other examples.

@jmobrien
Copy link
Copy Markdown
Collaborator Author

Makes sense, easy enough to change. I'll add some examples, too.

Comment thread R/fetch_description.R
url = description_url,
query = list(format = "qsf"),
as = "text",
encoding = "UTF-8" # Prevents a warning from guessing encoding
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we instead make encoding an argument to this function so folks can pass in the encoding they need, as outlined in #336? We can still use UTF-8 as the argument default.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my reply in #336 about this--we can definitely do this if it's valuable, but I think we may have some other things to fix first before being able to properly decide on that.

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

Successfully merging this pull request may close these issues.

2 participants