Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tylermorganwall/adjustedcranlogs
Removes daily shared downloads amongst CRAN packages and re-download/CRAN mirror spikes associated with package updates.
https://github.com/tylermorganwall/adjustedcranlogs
Last synced: about 2 months ago
JSON representation
Removes daily shared downloads amongst CRAN packages and re-download/CRAN mirror spikes associated with package updates.
- Host: GitHub
- URL: https://github.com/tylermorganwall/adjustedcranlogs
- Owner: tylermorganwall
- License: other
- Created: 2017-11-16T13:35:37.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-02-24T00:56:15.000Z (almost 5 years ago)
- Last Synced: 2023-11-20T12:32:40.532Z (about 1 year ago)
- Language: R
- Size: 558 KB
- Stars: 26
- Watchers: 2
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output:
github_document:
html_preview: false
---```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/images/README-"
)
```# adjustedcranlogs
[![CRAN_Status_Badge]( http://www.r-pkg.org/badges/version-ago/adjustedcranlogs)](http://cran.r-project.org/package=adjustedcranlogs)
## Overview
**adjustedcranlogs** is a wrapper around the **cranlogs** package that removes CRAN-wide shared daily downloads and re-download/CRAN mirror spikes due to package updates.
## Installation
```{r, eval=FALSE}
# To install:
install.packages("adjustedcranlogs")# To install developmental version:
# install.packages("devtools")
devtools::install_github("tylermorganwall/adjustedcranlogs")
```## Function (there's only one)
* `adj_cran_downloads()` Wrapper around **cranlogs** function `cran_downloads()`. Works the same, but returns a data frame showing the adjusted downloads, adjusted total downloads, shared minimum downloads, and package update information.
## Usage
```{r, include=FALSE}
set.seed(2)
``````{r example, message = FALSE}
library(adjustedcranlogs)
library(ggplot2)
library(dplyr)
library(lubridate)mypkgdownloads = adj_cran_downloads("skpr",from = "2017-08-15", to = "2017-11-15")
mypkgdownloads %>%
ggplot() +
geom_line(aes(x=date,y=adjusted_total_downloads)) +
geom_line(aes(x=date,y=total_downloads),color="red",linetype="dashed") +
annotate("text",y=400,x=dmy("01-10-2017"),label="Raw Downloads",color="red") +
annotate("text",y=50,x=dmy("20-10-2017"),label="Adjusted Downloads",color="black") +
theme_minimal()```