dfalbel commited on
Commit
4ef7a73
1 Parent(s): a781e20

add data and all

Browse files
.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ .Rproj.user
2
+ raw/*
3
+ licenses.parquet
01-join-files.R ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ library(tidyverse)
2
+ library(arrow)
3
+
4
+ files <- open_dataset("raw")
5
+ licenses <- open_dataset("licenses.parquet")
6
+
7
+ options(arrow.skip_nul = TRUE)
8
+ files <- files %>%
9
+ left_join(licenses, by = "repo_name") %>%
10
+ collect() %>%
11
+ group_by(license)
12
+
13
+ files %>%
14
+ write_dataset("data/r/", hive_style = TRUE)
15
+
16
+
17
+
README.md CHANGED
@@ -1,3 +1,58 @@
1
  ---
2
  license: other
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: other
3
+ task_categories:
4
+ - text-generation
5
+ language:
6
+ - code
7
+ pretty_name: github-r-repos
8
+ size_categories:
9
+ - 100K<n<1M
10
  ---
11
+
12
+ ## GitHub R repositories dataset
13
+
14
+ R source files from GitHub.
15
+
16
+ This dataset has been created using the public GitHub datasets from Google BigQuery.
17
+ This is the actual query that has been used to export the data:
18
+
19
+ ```
20
+ EXPORT DATA
21
+ OPTIONS (
22
+ uri = 'gs://your-bucket/gh-r/*.parquet',
23
+ format = 'PARQUET') as
24
+ (
25
+ select
26
+ f.id, f.repo_name, f.path,
27
+ c.content, c.size
28
+ from (
29
+ SELECT distinct
30
+ id, repo_name, path
31
+ FROM `bigquery-public-data.github_repos.files`
32
+ where ends_with(path, ".R")
33
+ ) as f
34
+ left join `bigquery-public-data.github_repos.contents` as c on f.id = c.id
35
+ )
36
+
37
+ EXPORT_DATA
38
+ OPTIONS (
39
+ uri = 'gs://your-bucket/licenses.parquet',
40
+ format = 'PARQUET') as
41
+ (select * from `bigquery-public-data.github_repos.licenses`)
42
+ ```
43
+
44
+ Files were then exported and processed locally with files in the root of this repository.
45
+ Datasets in this repository contain data from reositories with different licenses.
46
+
47
+ The data schema is:
48
+
49
+ ```
50
+ id: string
51
+ repo_name: string
52
+ path: string
53
+ content: string
54
+ size: int32
55
+ license: string
56
+ ```
57
+
58
+ Last updated: Jun 6th 2023
data/r/license=agpl-3.0/part-0.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:65a4192bce65d6bf6c52c1d72d771fef0adb70436ff9d11c81fe51dcbb110daa
3
+ size 12171406
data/r/license=apache-2.0/part-0.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:684dc309f80f5025602f4e196071f585e8b2eaceb53abedbc5e22e0681b7e3fb
3
+ size 87181401
data/r/license=artistic-2.0/part-0.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e9b4189434abad96a67bceacc19f4a5bf5864e3a8d58b334d9df18f084959af6
3
+ size 1844740
data/r/license=bsd-2-clause/part-0.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b26bf54c796874651673cd41b206263c924c737fd2357a843f8d4dde1a930796
3
+ size 7081829
data/r/license=bsd-3-clause/part-0.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f0805f2e44296b4a409a85f77b1118c796505790b8c906ebf27db4ab514cb287
3
+ size 11141702
data/r/license=cc0-1.0/part-0.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e0d9c49ceafff649f8274b9847e5ee7967c361cd1dfb24ea94be1f2a59df6ae
3
+ size 10819697
data/r/license=epl-1.0/part-0.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:be6cfa0f5bc39ff3e3cdf6037a62ba1c4a201b779a2f6dea9ad904e4a9a8ac79
3
+ size 685025
data/r/license=gpl-2.0/part-0.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4cdec49cd150e2ce82b99945f0d852319afda2a49f8a804668b02b30ad11bef3
3
+ size 179162892
data/r/license=gpl-3.0/part-0.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3e7cafbdb8e6e3b9fcc01a8b8c6066985a8a3447fd0c1bb7c90c8fe01634b57c
3
+ size 155039602
data/r/license=isc/part-0.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f093b56e1326b2e4436be96ffd248153e2dd7624792af1e17a247dccacf3858b
3
+ size 590886
data/r/license=lgpl-2.1/part-0.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:84c5e42a6a5d64269afe2b1041ce2705ba6127a5eaeea08f6e862a836853c93b
3
+ size 1140055
data/r/license=lgpl-3.0/part-0.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:16a116d7f24ba01ae307ad4c5040b59588ae682029ddc7b12e44828c8db0a745
3
+ size 10610827
data/r/license=mit/part-0.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1469594fde8fb02c0fd7611d69b117cdc2ee92cc8e035c71d5b4e2b8f97cfabc
3
+ size 123271217
data/r/license=mpl-2.0/part-0.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b3e451568fc29e0e95db611935f8b90af67a6e8c6e29c3941e27de2bc55405de
3
+ size 1223761
data/r/license=unlicense/part-0.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ea5a1998de02beeb5ca33ee6ff545d6ccfc22836a403668f987dfec9009f545b
3
+ size 2013263
github-r-repos.Rproj ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Version: 1.0
2
+
3
+ RestoreWorkspace: No
4
+ SaveWorkspace: No
5
+ AlwaysSaveHistory: Default
6
+
7
+ EnableCodeIndexing: Yes
8
+ UseSpacesForTab: Yes
9
+ NumSpacesForTab: 2
10
+ Encoding: UTF-8
11
+
12
+ RnwWeave: Sweave
13
+ LaTeX: pdfLaTeX
14
+
15
+ AutoAppendNewline: Yes
16
+ StripTrailingWhitespace: Yes
17
+ LineEndingConversion: Posix