Skip to content
This repository has been archived by the owner on Dec 30, 2023. It is now read-only.

Commit

Permalink
fix impact_cite_metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
kamclean committed Feb 16, 2020
1 parent 1e24e6e commit d09b237
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .Rproj.user/C9AE6405/pcs/source-pane.pper
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"activeTab" : 2
"activeTab" : -1
}
2 changes: 1 addition & 1 deletion .Rproj.user/C9AE6405/pcs/windowlayoutstate.pper
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"right" : {
"panelheight" : 729,
"splitterpos" : 281,
"topwindowstate" : "NORMAL",
"topwindowstate" : "HIDE",
"windowheight" : 803
}
}
8 changes: 4 additions & 4 deletions .Rproj.user/C9AE6405/persistent-state
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
activeClientUrl="https://argonaut.is.ed.ac.uk/s/3b4b3e1b2674a2ac72186/"
build-last-errors="[]"
build-last-errors-base-dir=""
build-last-outputs="[]"
build-last-errors-base-dir="~/impactr/"
build-last-outputs="[{\"output\":\"==> R CMD INSTALL --no-multiarch --with-keep.source impactr\\n\\n\",\"type\":0},{\"output\":\"* installing to library ‘/home/kmclean/impactr/packrat/lib/x86_64-pc-linux-gnu/3.4.4’\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"* installing *source* package ‘impactr’ ...\\n\",\"type\":1},{\"output\":\"** R\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** preparing package for lazy loading\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"Warning: replacing previous import ‘dplyr::intersect’ by ‘lubridate::intersect’ when loading ‘impactr’\\n\",\"type\":2},{\"output\":\"Warning: replacing previous import ‘dplyr::union’ by ‘lubridate::union’ when loading ‘impactr’\\n\",\"type\":2},{\"output\":\"Warning: replacing previous import ‘dplyr::setdiff’ by ‘lubridate::setdiff’ when loading ‘impactr’\\n\",\"type\":2},{\"output\":\"Warning: replacing previous import ‘magrittr::set_names’ by ‘purrr::set_names’ when loading ‘impactr’\\n\",\"type\":2},{\"output\":\"\",\"type\":1},{\"output\":\"Warning: replacing previous import ‘magrittr::extract’ by ‘tidyr::extract’ when loading ‘impactr’\\n\",\"type\":2},{\"output\":\"\",\"type\":1},{\"output\":\"** help\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"*** installing help indices\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"*** copying figures\\n\",\"type\":1},{\"output\":\"** building package indices\\n\",\"type\":1},{\"output\":\"** installing vignettes\\n\",\"type\":1},{\"output\":\"** testing if installed package can be loaded\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"========================================\\n\",\"type\":1},{\"output\":\"ComplexHeatmap version 2.3.2\\n\",\"type\":1},{\"output\":\"Bioconductor page: http://bioconductor.org/packages/ComplexHeatmap/\\n\",\"type\":1},{\"output\":\"Github page: https://github.com/jokergoo/ComplexHeatmap\\n\",\"type\":1},{\"output\":\"Documentation: http://jokergoo.github.io/ComplexHeatmap-reference\\n\",\"type\":1},{\"output\":\"\\n\",\"type\":1},{\"output\":\"If you use it in published research, please cite:\\n\",\"type\":1},{\"output\":\"Gu, Z. Complex heatmaps reveal patterns and correlations in multidimensional \\n\",\"type\":1},{\"output\":\" genomic data. Bioinformatics 2016.\\n\",\"type\":1},{\"output\":\"\\n\",\"type\":1},{\"output\":\"This message can be suppressed by:\\n\",\"type\":1},{\"output\":\" suppressPackageStartupMessages(library(ComplexHeatmap))\\n\",\"type\":1},{\"output\":\"========================================\\n\",\"type\":1},{\"output\":\"\\n\",\"type\":1},{\"output\":\"Warning: replacing previous import ‘dplyr::intersect’ by ‘lubridate::intersect’ when loading ‘impactr’\\n\",\"type\":2},{\"output\":\"Warning: replacing previous import ‘dplyr::union’ by ‘lubridate::union’ when loading ‘impactr’\\n\",\"type\":2},{\"output\":\"Warning: replacing previous import ‘dplyr::setdiff’ by ‘lubridate::setdiff’ when loading ‘impactr’\\n\",\"type\":2},{\"output\":\"Warning: replacing previous import ‘magrittr::set_names’ by ‘purrr::set_names’ when loading ‘impactr’\\n\",\"type\":2},{\"output\":\"Warning: replacing previous import ‘magrittr::extract’ by ‘tidyr::extract’ when loading ‘impactr’\\n\",\"type\":2},{\"output\":\"\",\"type\":1},{\"output\":\"* DONE (impactr)\\n\",\"type\":1},{\"output\":\"\",\"type\":1}]"
compile_pdf_state="{\"errors\":[],\"output\":\"\",\"running\":false,\"tab_visible\":false,\"target_file\":\"\"}"
files.monitored-path=""
find-in-files-state="{\"handle\":\"\",\"input\":\"\",\"path\":\"\",\"regex\":true,\"results\":{\"file\":[],\"line\":[],\"lineValue\":[],\"matchOff\":[],\"matchOn\":[]},\"running\":false}"
imageDirtyState="0"
imageDirtyState="1"
packratEnabled="1"
portToken="98c62d446885"
portToken="ff434c00670f"
saveActionState="0"
4 changes: 2 additions & 2 deletions .Rproj.user/C9AE6405/sources/prop/80D7015F
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"cursorPosition" : "4,10",
"scrollLine" : "0"
"cursorPosition" : "9,0",
"scrollLine" : "5"
}
1 change: 1 addition & 0 deletions .Rproj.user/C9AE6405/sources/prop/INDEX
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
~%2Fimpactr%2Fvignettes%2Fvignette_4_author.md="19109AD"
~%2Fimpactr%2Fvignettes%2Fvignette_5_altmetric.Rmd="8EB4E4DB"
~%2Fimpactr%2Fvignettes%2Fvignette_5_altmetric.md="3F0EB0A0"
~%2Fimpactr%2Fvignettes%2Fvignette_rmd%2Fvignette_3_traditional.Rmd="2291CABC"
~%2Fstarsurg_impact%2Fapp%2Fimpact%2Fapp.R="31B75BF0"
~%2Fstarsurg_impact%2Fapp%2Fimpact%2Fstarsurg_altmetric.Rmd="649322E"
~%2Fstarsurg_impact%2Fapp%2Fimpact%2Fstarsurg_citation.Rmd="A0842B9C"
Expand Down
2 changes: 1 addition & 1 deletion .Rproj.user/C9AE6405/sources/s-2ac72186/lock_file
Original file line number Diff line number Diff line change
@@ -1 +1 @@
42801
53382
1 change: 1 addition & 0 deletions .Rproj.user/shared/notebooks/paths
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
/home/kmclean/impactr/R/score_alm.R="C0E2D5F6"
/home/kmclean/impactr/README.md="49EA9396"
/home/kmclean/impactr/man/comb_name_size.Rd="C7D70E07"
/home/kmclean/impactr/vignettes/vignette_rmd/vignette_3_traditional.Rmd="4F93523A"
/home/kmclean/starsurg_impact/app/impact/app.R="53B9CA75"
/home/kmclean/starsurg_impact/app/impact/starsurg_altmetric.Rmd="ADC030BC"
/home/kmclean/starsurg_impact/app/impact/starsurg_citation.Rmd="743B1039"
Expand Down
2 changes: 1 addition & 1 deletion .Rproj.user/shared/users/2ac72186.lock
Original file line number Diff line number Diff line change
@@ -1 +1 @@
42801
53382
2 changes: 1 addition & 1 deletion .Rproj.user/shared/users/2ac72186.user
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"client_id":"cd962f00-5f96-4de4-899c-c1d83ddfcaa3","color":"#45e6b0","current_edit_id":"","currently_editing":"","last_seen":1581876691,"session_id":"2ac72186","time_since_last_seen":0,"username":"kmclean"}
{"client_id":"df518c25-556c-4f5a-97a1-f70df6e15478","color":"#45e6b0","current_edit_id":"","currently_editing":"","last_seen":1581879361,"session_id":"2ac72186","time_since_last_seen":0,"username":"kmclean"}
6 changes: 3 additions & 3 deletions .Ruserdata/kmclean/.Rhistory
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
df_na <- rbind.data.frame(rep(NA, length(extract_var[which(extract_var %ni% names(x))])))
colnames(df_na) <- extract_var[which(extract_var %ni% names(x))]}
y <- tibble::as_tibble(x)
if(is.null(df_na)==F){y <- cbind.data.frame(y, df_na)}
y <- y %>%
dplyr::select("doi" = "DOI", "journal_abbr" = `container-title-short`,"journal_full" = `container-title`,
Expand Down Expand Up @@ -510,3 +507,6 @@ library(impactr)
devtools::document()
devtools::document()
library(impactr)
packrat::init(options = list(external.packages = c("ComplexHeatmap", "sjrdata")))
packrat::init(options = list(external.packages = c("ComplexHeatmap", "sjrdata")))
library(impactr)
6 changes: 3 additions & 3 deletions R/impact_cite_metric.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

# Function-------------------------------
impact_cite_metric <- function(citations, year = ""){

require(dplyr)
if(length(citations)==length(year)){df <- dplyr::bind_cols("n_cite" = citations,
"year" = as.numeric(year))}

if(length(citations)!=length(year)){df <- dplyr::bind_cols("n_cite" = citations,
"year" = rep(min(as.numeric(year)),
length(citations)))}

table(df$year)
if(year==""){df <- dplyr::bind_cols("n_cite" = citations,
"year" = rep(NA,
length(citations)))}
Expand All @@ -32,7 +32,7 @@ impact_cite_metric <- function(citations, year = ""){
total_cite = sum(n_cite)) %>%
dplyr::mutate(hindex = max(which(id<=n_cite)),
gindex = max(which(gindex_square<gindex_cumsum))) %>%
dplyr::mutate(mquotient = unique(hindex)/(lubridate::year(Sys.Date())-min(year))) %>%
dplyr::mutate(mquotient = unique(hindex)/(year)) %>%
head(1) %>% dplyr::select(total_cite:mquotient)

return(out)}
2 changes: 1 addition & 1 deletion vignettes/vignette_rmd/vignette_3_traditional.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ data <- impactr::extract_pmid(pmid) %>%
journal_edit = ifelse(journal_edit=="British Medical Journal", "BMJ-British Medical Journal", journal_edit))
```

# Research Impact
# Impact from Traditional Metrics

Citations are a common metric for determining the impact of research on the wider academic field. Both `extract_pmid()` and `extract_doi()` will provide data on citations (based on PubMed/Crossref repositories) and journal impact factor (based on [Scimago Scientific Journal Rankings](https://www.scimagojr.com)).

Expand Down

0 comments on commit d09b237

Please sign in to comment.