Skip to content

Commit 5363c58

Browse files
authored
Merge pull request #22 from nih-cfde/pr15-updates
copilot adds to readme
2 parents 03625a9 + 562ad4c commit 5363c58

File tree

5 files changed

+411
-17
lines changed

5 files changed

+411
-17
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
terraform/
1010
DEVELOPER.md
1111
^README\.Rmd$
12+
^CODE_OF_CONDUCT\.md$

CODE_OF_CONDUCT.md

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# Code of Conduct
2+
3+
We abide the [CU code of conduct](https://www.cu.edu/ope/aps/2027) as part of our association with the University of Colorado Anshutz Medical Campus.
4+
5+
Additionally, we follow the Contributor Covenant Code of Conduct, as found below.
6+
7+
## Contributor Covenant Code of Conduct
8+
9+
## Our Pledge
10+
11+
We as members, contributors, and leaders pledge to make participation in our
12+
community a harassment-free experience for everyone, regardless of age, body
13+
size, visible or invisible disability, ethnicity, sex characteristics, gender
14+
identity and expression, level of experience, education, socioeconomic status,
15+
nationality, personal appearance, race, caste, color, religion, or sexual
16+
identity and orientation.
17+
18+
We pledge to act and interact in ways that contribute to an open, welcoming,
19+
diverse, inclusive, and healthy community.
20+
21+
## Our Standards
22+
23+
Examples of behavior that contributes to a positive environment for our
24+
community include:
25+
26+
- Demonstrating empathy and kindness toward other people
27+
- Being respectful of differing opinions, viewpoints, and experiences
28+
- Giving and gracefully accepting constructive feedback
29+
- Accepting responsibility and apologizing to those affected by our mistakes,
30+
and learning from the experience
31+
- Focusing on what is best not just for us as individuals, but for the overall
32+
community
33+
34+
Examples of unacceptable behavior include:
35+
36+
- The use of sexualized language or imagery, and sexual attention or advances of
37+
any kind
38+
- Trolling, insulting or derogatory comments, and personal or political attacks
39+
- Public or private harassment
40+
- Publishing others' private information, such as a physical or email address,
41+
without their explicit permission
42+
- Other conduct which could reasonably be considered inappropriate in a
43+
professional setting
44+
45+
## Enforcement Responsibilities
46+
47+
Community leaders are responsible for clarifying and enforcing our standards of
48+
acceptable behavior and will take appropriate and fair corrective action in
49+
response to any behavior that they deem inappropriate, threatening, offensive,
50+
or harmful.
51+
52+
Community leaders have the right and responsibility to remove, edit, or reject
53+
comments, commits, code, wiki edits, issues, and other contributions that are
54+
not aligned to this Code of Conduct, and will communicate reasons for moderation
55+
decisions when appropriate.
56+
57+
## Scope
58+
59+
This Code of Conduct applies within all community spaces, and also applies when
60+
an individual is officially representing the community in public spaces.
61+
Examples of representing our community include using an official email address,
62+
posting via an official social media account, or acting as an appointed
63+
representative at an online or offline event.
64+
65+
## Enforcement
66+
67+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
68+
reported to the community leaders responsible for enforcement.
69+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to community leaders responsible for enforcement.
70+
Please open a [new security advisory notice](https://github.com/CU-DBMI/.github/security/advisories/new) (using defaults or “n/a” where unable to fill in the form) to privately notify us of any incidents of this nature.
71+
All complaints will be reviewed and investigated promptly and fairly.
72+
73+
All community leaders are obligated to respect the privacy and security of the
74+
reporter of any incident.
75+
76+
## Enforcement Guidelines
77+
78+
Community leaders will follow these Community Impact Guidelines in determining
79+
the consequences for any action they deem in violation of this Code of Conduct:
80+
81+
### 1. Correction
82+
83+
**Community Impact**: Use of inappropriate language or other behavior deemed
84+
unprofessional or unwelcome in the community.
85+
86+
**Consequence**: A private, written warning from community leaders, providing
87+
clarity around the nature of the violation and an explanation of why the
88+
behavior was inappropriate. A public apology may be requested.
89+
90+
### 2. Warning
91+
92+
**Community Impact**: A violation through a single incident or series of
93+
actions.
94+
95+
**Consequence**: A warning with consequences for continued behavior. No
96+
interaction with the people involved, including unsolicited interaction with
97+
those enforcing the Code of Conduct, for a specified period of time. This
98+
includes avoiding interactions in community spaces as well as external channels
99+
like social media. Violating these terms may lead to a temporary or permanent
100+
ban.
101+
102+
### 3. Temporary Ban
103+
104+
**Community Impact**: A serious violation of community standards, including
105+
sustained inappropriate behavior.
106+
107+
**Consequence**: A temporary ban from any sort of interaction or public
108+
communication with the community for a specified period of time. No public or
109+
private interaction with the people involved, including unsolicited interaction
110+
with those enforcing the Code of Conduct, is allowed during this period.
111+
Violating these terms may lead to a permanent ban.
112+
113+
### 4. Permanent Ban
114+
115+
**Community Impact**: Demonstrating a pattern of violation of community
116+
standards, including sustained inappropriate behavior, harassment of an
117+
individual, or aggression toward or disparagement of classes of individuals.
118+
119+
**Consequence**: A permanent ban from any sort of public interaction within the
120+
community.
121+
122+
## Attribution
123+
124+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
125+
version 2.1, available at
126+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
127+
128+
Community Impact Guidelines were inspired by
129+
[Mozilla's code of conduct enforcement ladder][mozilla coc].
130+
131+
For answers to common questions about this code of conduct, see the FAQ at
132+
[https://www.contributor-covenant.org/faq][faq]. Translations are available at
133+
[https://www.contributor-covenant.org/translations][translations].
134+
135+
[faq]: https://www.contributor-covenant.org/faq
136+
[homepage]: https://www.contributor-covenant.org
137+
[mozilla coc]: https://github.com/mozilla/diversity
138+
[translations]: https://www.contributor-covenant.org/translations
139+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
YEAR: 2025
2-
COPYRIGHT HOLDER: programets authors
2+
COPYRIGHT HOLDER: programets authors

README.Rmd

Lines changed: 124 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,151 @@ knitr::opts_chunk$set(
1919
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
2020
<!-- badges: end -->
2121

22-
The goal of programets is to compile public metrics from iCite, Google Analytics, GitHub, and related sources to help researchers understand how their NIH project engages with the broader research community. The package is designed to highlight how project impact evolves over time, such as in response to publications or events.
22+
**programets** is an R package for collecting and analyzing academic impact metrics for NIH-funded research projects. It aggregates data from multiple public sources to help researchers, program managers, and evaluators understand how their projects engage with the broader research community over time.
23+
24+
## What Does It Do?
25+
26+
The package provides unified access to:
27+
28+
- **NIH RePORTER** - Project metadata, funding details, and associated publications
29+
- **iCite** - Citation metrics including Relative Citation Ratio (RCR) for PubMed publications
30+
- **GitHub** - Repository metrics (stars, forks, commits, contributors, issues, PRs) for projects tagged with NIH Core Project Numbers
31+
- **Google Analytics** - Web traffic and engagement data for project websites
32+
- **Europe PMC** - Literature search across millions of publications
2333

2434
## Installation
2535

26-
You can install the development version of programets from [GitHub](https://github.com/) with:
36+
Install the development version from GitHub:
2737

2838
``` r
2939
# install.packages("pak")
3040
pak::pak("nih-cfde/programets")
3141
```
3242

33-
## Example Usage
43+
**Requirements:**
44+
- R >= 4.1.0
45+
- For GitHub data: A Personal Access Token is recommended for higher rate limits
3446

35-
Query the NIH RePORTER:
47+
## Quick Start
48+
49+
### 1. Query NIH RePORTER for Project Information
50+
51+
Retrieve comprehensive project metadata including publications, funding details, and principal investigators:
3652

3753
```{r reporter_example}
3854
library(programets)
3955
56+
# Get project info for one or more NIH Core Project Numbers
4057
proj_info <- get_core_project_info(c("u24ca289073"))
4158
proj_info |> colnames()
4259
```
4360

44-
Tag your GitHub repositories with NIH Core Project Numbers to download common metrics:
61+
Available fields include: project title, abstract, funding amounts, dates, PIs, publications (PMIDs), and more.
62+
63+
### 2. Get GitHub Repository Metrics
64+
65+
If your project repositories are tagged with NIH Core Project Numbers as topics, you can collect engagement metrics:
4566

4667
```{r git_example}
68+
# Fetch GitHub metrics for repos tagged with your project number
4769
df <- get_github_by_topic(c("u24ca289073"))
4870
df |> colnames()
4971
```
5072

73+
Metrics include: stars, watchers, forks, open/closed issues, open/closed PRs, commit count, contributor count, and more.
74+
75+
**Tip:** Tag your GitHub repositories with your NIH Core Project Number (e.g., `u24ca289073`) to enable discovery.
76+
77+
### 3. Get Citation Metrics from iCite
78+
79+
Calculate impact metrics including the Relative Citation Ratio (RCR) for your publications:
80+
81+
```{r icite_example, eval=FALSE}
82+
# Get citation metrics for PubMed IDs
83+
pmids <- c(26001965, 25015380)
84+
citation_data <- icite(pmids)
85+
86+
# View RCR and other metrics
87+
dplyr::select(citation_data, pmid, title, year,
88+
relative_citation_ratio, citation_count)
89+
```
90+
91+
### 4. Search Europe PMC for Publications
92+
93+
Query millions of publications with flexible search syntax:
94+
95+
```{r epmc_example, eval=FALSE}
96+
# Search for publications related to CRISPR
97+
crispr_pubs <- epmc_search(query = "crispr", page_limit = 2)
98+
99+
# Search by author
100+
author_pubs <- epmc_search(query = 'AUTH:"Smith J"', page_limit = 1)
101+
```
102+
103+
### 5. Access Google Analytics Data
104+
105+
Retrieve web traffic data for project websites (requires authentication):
106+
107+
```{r ga_example, eval=FALSE}
108+
# Authenticate with Google (first time only)
109+
googleAnalyticsR::ga_auth()
110+
111+
# Get traffic data
112+
traffic <- ga_dataframe(
113+
property_id = "123456789",
114+
start_date = "2024-01-01",
115+
end_date = "2024-12-31",
116+
metrics = c("activeUsers", "sessions"),
117+
dimensions = c("date", "country")
118+
)
119+
```
120+
121+
## Authentication
122+
123+
### GitHub
124+
For increased API rate limits, set up a Personal Access Token:
125+
126+
```{r github_token, eval=FALSE}
127+
# Create a token with: usethis::create_github_token()
128+
# Then use it in your calls:
129+
df <- get_github_by_topic(c("u24ca289073"), token = "your_token_here")
130+
```
131+
132+
### Google Analytics
133+
First-time setup requires authentication:
134+
135+
```{r ga_auth, eval=FALSE}
136+
# Opens browser for Google account authorization
137+
googleAnalyticsR::ga_auth()
138+
139+
# For non-interactive use, see DEVELOPER.md for service account setup
140+
```
141+
142+
## Use Cases
143+
144+
- **Impact Reporting**: Generate comprehensive reports combining publication citations, web traffic, and GitHub engagement
145+
- **Trend Analysis**: Track how metrics evolve over time in response to publications, presentations, or events
146+
- **Portfolio Management**: Compare metrics across multiple projects or funding opportunities
147+
- **Compliance**: Document project outputs and community engagement for progress reports
148+
149+
## Documentation
150+
151+
- **Function Reference**: See `?get_core_project_info`, `?icite`, `?get_github_by_topic`, etc.
152+
- **Vignettes**: Browse vignettes for detailed workflows
153+
- **Developer Notes**: See `DEVELOPER.md` for advanced setup (service accounts, encryption)
154+
155+
## Getting Help
156+
157+
- File issues at: https://github.com/nih-cfde/programets/issues
158+
- Review examples in the vignettes
159+
- Check function documentation with `?function_name`
160+
161+
## Authors
162+
163+
- Sean Davis ([email protected])
164+
- David Mayer ([email protected])
165+
166+
## License
167+
168+
MIT
169+

0 commit comments

Comments
 (0)