-
Notifications
You must be signed in to change notification settings - Fork 1
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
RIS file not exporting from Shiny app #176
Comments
I noticed the same thing and have it listed on issue #152 which has a number of consolidated shiny issues. |
This error is due to a change I made recently to help users map IDs and tags to specific fields. I wanted to give the user an option to review the mapping before export. I'm not sure if we could replicate this function in the shiny export, but that would be nice. I'll keep looking at this - I'm also going to remove it from #152 as this mapping function would be useful. |
possible to add these option in the shiny with this? - I'm not experienced with the shiny UI file. Let's discuss. export_ris_shiny <- function(input, output, session, citations, filename = "output.ris") {
# Default mapping of RIS fields to citations columns
default_mapping <- reactive({
list(
"DB" = input$cite_source_include,
"C7" = input$cite_label_include,
"C8" = input$cite_string_include,
"C1" = input$duplicate_id,
"C2" = input$record_ids
)
})
observeEvent(input$confirm_mapping, {
# Rename the citations columns according to the final mapping
for (field in names(default_mapping())) {
if (default_mapping()[[field]] %in% names(citations)) {
citations <- citations %>% dplyr::rename(!!field := .data[[default_mapping()[[field]]]])
}
}
# Currently, write_refs does not accept tibbles, thus converted
write_refs(as.data.frame(citations), file = filename)
})
} need to add the appropriate input widgets to your UI for the user to select the mapping, and an action button with the ID confirm_mapping for the user to confirm the mapping. |
I changed the function back so it is able to download RIS - with the default mapping for the moment (so the shiny works) whilst I try and include mapping choices |
I'm still running into export issues with the .ris in the shiny, still tries do download as downloadRis.htm |
Because I forgot to merge the pull request! |
I get the following message when trying to export RIS (csv and bibtex are working fine):
Warning in export_ris(rv$latest_unique, file) :
Function saves a RIS file, so filename should (usually) end in .ris. For now, name is used as provided.
Final Mapping:
DB : cite_source_include
C7 : cite_label_include
C8 : cite_string_include
C1 : duplicate_id
C2 : record_ids
Do you want to proceed with this mapping? (yes/no): y
Export cancelled. Please modify your user_mapping argument and try again.
When I choose yes or no, it exports a file with this name: downloadRis.html and also gives me the following error (weirdly, nothing actually saves when I save this file or when I change the extension to RIS).
Export cancelled. Please modify your user_mapping argument and try again.
The text was updated successfully, but these errors were encountered: