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
extract_form_esummary matrix cannot be cleanly written to csv #65
Comments
This is not really a problem with rentrez, just a property of NCBI records and R objects. In this case, the pubtype field is variably-sized: sapply(pubrecord.table[4,], length)
When you try and write the matrix it represents the vectrors like you'd type them in ( In this case, you can collapse the vectors: pubrecord.table[4,] <- sapply(pubrecord.table[4,], paste, collapse=" & ") and unlist each matrix row to allow them to be written out f <- tempfile()
write.csv( apply(pubrecord.table, 1, unlist), f)
re_read <- read.csv(f)
re_read$pmcrefcount
|
Hi david,
|
I'm not sure what you are trying to in the example, but it seems like it's hitting empty fields?
df <- as.data.frame(t(pubrecord.table))
df$pubtype
Structured data like that would seem to fit a list better than a |
*Edited, noted the issue *
This results in NA for PMIDs where abstracts are empty. But, when It is being rendered using Rshiny it has problem displaying the table just shows "Processing" but does not display any table. need to learn more about it. |
OK, good luck to getting to the bottom of the shiny problem :) |
Hi David,
Below is the example. I did not understand why title, fulljournalname, pubtype has the text data extending to second column.
The text was updated successfully, but these errors were encountered: