Description Usage Arguments Details Value See Also Examples
Once the logs have been read in, this function can be used to calculate yearly, monthly or daily stats.
1 2 | stats_logs(dt, type="monthly", pacakges="data.table",
dependency=TRUE, duration=60L)
|
dt |
A |
type |
Calculates the number of downloads for specified packages monthly, daily or yearly. Default is |
packages |
A character vector of package names for which to calculate the stats for. Default is |
dependency |
When |
duration |
Default is 60 seconds. When |
By just looking at the number of downloads for each package provided in the packages argument, it'll not be possible to distinguish if the package was directly downloaded or was it because it was in the depends, suggests, imports etc. fields. In order to get the number of downloads for just the package that is specified, we start by gathering the number of downloads for all the packages that depend on it, within duration seconds +/-. We also use the proxy info provided for IP address from Rstudio mirror logs to find out if the dependent package and the actual package were downloaded by the same user.
We add all the downloads for each package provided in the package argument which satisfy these criterion and provide this information as an additional column, in addition to the total number of downloads for the packages specified.
A data.table with the number of downloads for the specified time frame and type and an additional column indicating the number of downlaods most likely due to the packages that depend on it, if dependency is set to TRUE.
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.