Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 55 lines (38 sloc) 1.345 kb
7d0531f @johnmyleswhite Code and data for the Dataists recommendation system contest
authored
1 #!/usr/bin/Rscript
2
3 source('lib/load_libraries.R')
4 source('lib/utilities.R')
5
6 date <- '08282010'
7
8 setwd(paste('/Users/johnmyleswhite/Statistics/Datasets/CRAN_', date, sep = ''))
9
10 package.tarballs <- dir('.')
11
12 package.maintainers <- data.frame()
13
14 for (package.tarball in package.tarballs)
15 {
16 package.name <- str_extract(package.tarball, '[^_]+')
17
18 print(paste('Processing', package.name))
19
20 system(paste('tar xfz', package.tarball))
21
22 setwd(package.name)
23
24 if (! file.exists('DESCRIPTION'))
25 {
26 print(paste(package.name, 'has no DESCRIPTION file.'))
27 next()
28 }
29
30 maintainers <- parse.description('Maintainer')
31
32 if (length(maintainers) > 0)
33 {
34 for (maintainer in maintainers)
35 {
36 package.maintainers <- rbind(package.maintainers,
37 data.frame(Package = package.name,
38 Maintainer = maintainer))
39 }
40 }
41
42 setwd('..')
43
44 system(paste('rm -rf', package.name))
45 }
46
47 write.csv(package.maintainers,
48 file = file.path('/Users/johnmyleswhite/Statistics/cran_contest/data',
49 'maintainers.csv'),
50 row.names = FALSE)
51
52 # The file that results from running this script unfortunately has several
53 # inappropriate newlines in it. In the data we've released, we've fixed
54 # these entries by hand.
Something went wrong with that request. Please try again.