Skip to content
Prev 361629 / 398506 Next

About identification of CRAN CHECK machines in logs

I don't know Hadley. But you can see evidence of "something" systematically
installing the packages in the log data. From my two CRAN packages I
noticed a high correlation in the number of downloads.

Try the following script, which will pick 5 random packages from CRAN and
calculate the correlation matrix between their differenced number of
downloads. To avoid spurious correlations,  I removed the weekends since we
can expect some seasonality and also the zero entries. Its crude, I know,
but it does shows some positive associations between the number of
installations of the packages.

If not CRAN, who/what is downloading this packages and how can I set it
apart from the actual user installations?

Many thanks!

____
# get packages
df <- as.data.frame(available.packages())

# choose 5 random
idx <- sample(seq(nrow(df)))[1:5]
df<- df[idx,]

my.pkgs <- as.character(df$Package)

#my.pkgs <- c('RndTexExams','GetTDData')

dl.df <- cranlogs::cran_downloads(my.pkgs, from = '2015-01-01', to =
Sys.Date())

# remove zeros entries
dl.df$count[dl.df$count==0] <- NA

# remove weekends
dl.df$sat.sun <- as.POSIXlt(dl.df$date)$wday
dl.df <- dplyr::filter(dl.df, sat.sun != 0, sat.sun != 6)

# to wide (for corr)
dl.df <- tidyr::spread(dl.df, key = package,value = count)

# remove na
dl.df <- dl.df[complete.cases(dl.df), ]

diff.mat <- diff(as.matrix(dl.df[,3:ncol(dl.df)]))
cor(diff.mat)

___
On Thu, Jun 9, 2016 at 6:18 PM, Hadley Wickham <h.wickham at gmail.com> wrote: