-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from nealhaddaway/Make_a_package
Make a package
- Loading branch information
Showing
41 changed files
with
59,752 additions
and
59,855 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
/Users/nealhaddaway/OneDrive - SEI/ESHackathon/4.Remote 2020/bibfix/R/decode_dois.R="F95AE8CF" | ||
/Users/nealhaddaway/OneDrive - SEI/ESHackathon/4.Remote 2020/bibfix/inst/shiny-examples/bibfix/app.R="16CC443D" | ||
/Users/nealhaddaway/OneDrive - SEI/ESHackathon/4.Remote 2020/bibfix/inst/shiny-examples/bibfix/build_ris.R="6F85CBC8" | ||
/Users/nealhaddaway/OneDrive - SEI/ESHackathon/4.Remote 2020/bibfix/inst/shiny-examples/bibfix/decode_dois.R="94F305F8" | ||
/Users/nealhaddaway/OneDrive - SEI/ESHackathon/4.Remote 2020/bibfix/inst/shiny-examples/bibfix/functions.R="0E38325C" | ||
/Users/nealhaddaway/OneDrive - SEI/ESHackathon/4.Remote 2020/bibfix/inst/shiny-examples/bibfix/google-analytics.html="FF9CB785" | ||
/Users/nealhaddaway/OneDrive - SEI/ESHackathon/4.Remote 2020/bibfix/inst/shiny-examples/bibfix/plot_health.R="B7F16593" | ||
/Users/nealhaddaway/OneDrive - SEI/ESHackathon/4.Remote 2020/bibfix/inst/shiny-examples/bibfix/repair_refs.R="3FACFBA9" | ||
/Users/nealhaddaway/OneDrive - SEI/ESHackathon/4.Remote 2020/bibfix/inst/shiny-examples/bibfix/scan_file.R="13B1F476" | ||
/Users/nealhaddaway/OneDrive - SEI/ESHackathon/4.Remote 2020/bibfix/inst/shiny-examples/bibfix/search_openAlex.R="EF8B2266" | ||
/Users/nealhaddaway/OneDrive - SEI/ESHackathon/4.Remote 2020/citationchaser private/citationchaser/inst/shiny-examples/citationchaser/app.R="03706E48" | ||
/Users/nealhaddaway/OneDrive - SEI/ESHackathon/4.Remote 2020/citationchaser private/citationchaser/inst/shiny-examples/citationchaser/functions.R="032381A8" | ||
/Users/nealhaddaway/OneDrive - SEI/ESHackathon/4.Remote 2020/citationchaser private/citationchaser/inst/shiny-examples/citationchaser/mixed_id_wrapper.R="8380540F" | ||
/Users/nealhaddaway/OneDrive - SEI/ESHackathon/4.Remote 2020/citationchasertest/inst/shiny-examples/citationchasertest/app.R="A216DC70" | ||
/Users/nealhaddaway/OneDrive - SEI/ESHackathon/4.Remote 2020/citationchasertest/inst/shiny-examples/citationchasertest/functions.R="D49257AD" | ||
/Users/nealhaddaway/OneDrive - SEI/ESHackathon/4.Remote 2020/citationchasertest/inst/shiny-examples/citationchasertest/mixed_id_wrapper.R="F1817740" | ||
C:/Users/matthew.grainger/Documents/Projects_in_development/bibfix/DESCRIPTION="6FA2B510" | ||
C:/Users/matthew.grainger/Documents/Projects_in_development/bibfix/R/build_ris.R="EC8188C9" | ||
C:/Users/matthew.grainger/Documents/Projects_in_development/bibfix/R/decode_dois.R="136028EC" | ||
C:/Users/matthew.grainger/Documents/Projects_in_development/bibfix/R/dev/fill_blanks.R="0C299367" | ||
C:/Users/matthew.grainger/Documents/Projects_in_development/bibfix/R/fill_blanks.R="1AA9D749" | ||
C:/Users/matthew.grainger/Documents/Projects_in_development/bibfix/R/functions.R="D6783113" | ||
C:/Users/matthew.grainger/Documents/Projects_in_development/bibfix/R/plot_health.R="24D8B67D" | ||
C:/Users/matthew.grainger/Documents/Projects_in_development/bibfix/R/repair_refs.R="81AE1A63" | ||
C:/Users/matthew.grainger/Documents/Projects_in_development/bibfix/R/runBibfixApp.R="D70915BB" | ||
C:/Users/matthew.grainger/Documents/Projects_in_development/bibfix/R/scan_file.R="5A66CA1E" | ||
C:/Users/matthew.grainger/Documents/Projects_in_development/bibfix/R/search_openAlex.R="0AA59F97" | ||
C:/Users/matthew.grainger/Documents/Projects_in_development/bibfix/R/update_retractionwatch_data.R="1A74B192" | ||
C:/Users/matthew.grainger/Documents/Projects_in_development/bibfix/inst/extdata/data.csv="708A568C" | ||
C:/Users/matthew.grainger/Documents/Projects_in_development/bibfix/inst/shiny-examples/bibfix/app.R="CF9E49B4" | ||
C:/Users/matthew.grainger/Documents/Projects_in_development/bibfix/inst/shiny-examples/bibfix/www/Factory_Scholar.ris="25D08583" | ||
C:/Users/matthew.grainger/Documents/Projects_in_development/bibfix/inst/shiny-examples/bibfix/www/Forest_scholar.ris="FA10FDC7" | ||
C:/Users/matthew.grainger/Documents/Projects_in_development/bibfix/inst/shiny-examples/bibfix/www/lookup_table.txt="6CF87D1B" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
export(build_ris) | ||
export(getLENSData) | ||
export(get_abstract) | ||
export(get_doi) | ||
export(get_urls) | ||
export(journal_abbreviation) | ||
export(remove_abstracts) | ||
importFrom(dplyr,coalesce) | ||
export(crawl_url) | ||
export(crawl_urls) | ||
export(decode_dois) | ||
export(get_citation) | ||
export(get_refs) | ||
export(reconstruct_abstract) | ||
export(repair_refs) | ||
export(runBibfixApp) | ||
export(scan_file) | ||
export(search_openAlex) | ||
importFrom(MESS,cumsumbinning) | ||
importFrom(data.table,data.table) | ||
importFrom(dplyr,bind_rows) | ||
importFrom(dplyr,group_split) | ||
importFrom(dplyr,mutate) | ||
importFrom(dplyr,rename) | ||
importFrom(dplyr,select) | ||
importFrom(expss,vlookup) | ||
importFrom(httr,POST) | ||
importFrom(httr,add_headers) | ||
importFrom(httr,content) | ||
importFrom(jsonlite,fromJSON) | ||
importFrom(magrittr,"%>%") | ||
importFrom(rcrossref,cr_abstract) | ||
importFrom(rcrossref,cr_works) | ||
importFrom(roadoi,oadoi_fetch) | ||
importFrom(stringdist,stringdist) | ||
importFrom(synthesisr,read_refs) | ||
importFrom(tidyr,unite) | ||
importFrom(maditr,vlookup) | ||
importFrom(stringi,stri_replace_all_fixed) | ||
importFrom(tibble,tibble) | ||
importFrom(utils,write.table) |
This file was deleted.
Oops, something went wrong.
0
inst/shiny-examples/bibfix/build_ris.R → R/build_ris.R
100755 → 100644
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,65 @@ | ||
#' Plot RIS file health | ||
#' remotes::install_git("https://git.rud.is/hrbrmstr/ggchicklet.git") | ||
#' health_check <- scan_file(refs) | ||
plot_health <- function(health_check){ | ||
#' report <- scan_file(refs) | ||
#' health_plot <- plot_health(report) | ||
#' health_plot | ||
plot_health <- function(health_check, session=NULL){ | ||
|
||
|
||
health_check<-health_check[-1] | ||
reportdf <- as.data.frame(health_check) | ||
|
||
# Select relevant fields including n_retracted | ||
reportdf <- select(reportdf, -c('n_complete', 'n_findable_titles', 'n_total')) | ||
names(reportdf) <- str_to_sentence(gsub('_', ' ', gsub('n_', '', names(reportdf)))) | ||
names(reportdf) <- gsub('Doi', 'DOI', names(reportdf)) | ||
|
||
# Add n_retracted to the report | ||
reportdf <- data.frame(field = names(reportdf), | ||
value = t(reportdf), | ||
row.names = NULL) | ||
|
||
# Include retracted in field levels | ||
reportdf$field <- factor(reportdf$field, | ||
levels = c('DOI', 'End page', 'Start page', | ||
'Issue', 'Volume', 'Journal', | ||
'Abstract', 'Title', 'Year', | ||
'Author', 'Retracted')) | ||
|
||
# Create missing data summary | ||
reportdf$health <- 'healthy' | ||
reportdf$field <- factor(reportdf$field, levels = c('DOI', 'End page', 'Start page', 'Issue', 'Volume', 'Journal', 'Abstract', 'Title', 'Year', 'Author')) | ||
new <- reportdf | ||
new$value <- health_check$n_total - reportdf$value | ||
new$health <- 'missing' | ||
reportdf <- rbind(reportdf, new) | ||
reportdf$health <- factor(reportdf$health, levels = c('missing', 'healthy')) | ||
|
||
#correct text size in ratio 14/5: https://stackoverflow.com/questions/25061822/ggplot-geom-text-font-size-control | ||
geom.text.size <- 5 | ||
theme.size <- 20 | ||
|
||
plot <- ggplot(data=reportdf, aes(x=value, y=field, fill=health)) + | ||
geom_bar(stat="identity", position = 'stack') + | ||
#geom_text(aes(label=value), position = position_dodge(width=0.9), hjust=-0.5, size=geom.text.size, color='grey50') + | ||
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), | ||
panel.background = element_blank(), | ||
axis.title.y=element_blank(), | ||
axis.ticks.y = element_blank(), | ||
text = element_text(size = theme.size, color="grey50"), | ||
axis.text = element_text(color="grey50")) + | ||
xlim(0, 1.1*max(reportdf$value)) + | ||
labs(x = "Health level of field") + | ||
scale_fill_manual(values=c('grey90', '#e43235')) + | ||
theme(legend.position = "none") | ||
# Plot setup | ||
geom.text.size <- 4 | ||
theme.size <- 16 | ||
|
||
return(plot) | ||
plot <- ggplot2::ggplot(data = reportdf, | ||
ggplot2::aes(x = value, y = field, fill = health)) + | ||
ggplot2::geom_bar(stat = "identity", position = 'stack') + | ||
ggplot2::theme_minimal(base_size = theme.size) + | ||
ggplot2::theme( | ||
axis.title.y = ggplot2::element_blank(), | ||
axis.ticks.y = ggplot2::element_blank(), | ||
text = ggplot2::element_text(size = theme.size, color = "grey50"), | ||
axis.text = ggplot2::element_text(color = "grey50"), | ||
legend.position = "none" | ||
) + | ||
ggplot2::xlim(0, 1.1 * max(reportdf$value)) + | ||
ggplot2::labs(x = "Health level of field") + | ||
ggplot2::scale_fill_manual(values = c('grey90', '#e43235')) | ||
if (shiny::isTruthy(session)) { | ||
# Convert to interactive plot | ||
plot <- plotly::ggplotly(plot, tooltip = "x") | ||
config(plot, displayModeBar = FALSE) | ||
|
||
}else{ | ||
plot | ||
} | ||
|
||
return(plot) | ||
} |
Oops, something went wrong.