|
1 | 1 |
|
2 | | -#NAME,TYPE,LANGUAGE,FILES,LOCS,DATABASE,LICENSE,ENDPOINTS,URL |
| 2 | +#EMB,NAME,TYPE,LANGUAGE,RUNTIME,BUILD,FILES,LOCS,DATABASE,LICENSE,ENDPOINTS,URL |
3 | 3 | DATA_FILE="./data.csv" |
4 | 4 |
|
| 5 | +UNDEFINED = "UNDEFINED" |
| 6 | + |
| 7 | +handleMultiValues <- function(s){ |
| 8 | + return(gsub(";", ", ", s)) |
| 9 | +} |
| 10 | + |
| 11 | +markdown <- function (){ |
| 12 | + |
| 13 | + dt <- read.csv(DATA_FILE,header=T) |
| 14 | + |
| 15 | + dt = dt[order(dt$TYPE, dt$LANGUAGE, -dt$LOCS, dt$NAME),] |
| 16 | + # skip industrial APIs that are not stored in EMB |
| 17 | + dt = dt[dt$EMB==TRUE,] |
| 18 | + |
| 19 | + TABLE = "./table_emb.md" |
| 20 | + unlink(TABLE) |
| 21 | + sink(TABLE, append = TRUE, split = TRUE) |
| 22 | + |
| 23 | + #EMB,NAME,TYPE,LANGUAGE,RUNTIME,BUILD,FILES,LOCS,DATABASE,LICENSE,ENDPOINTS,URL |
| 24 | + cat("|Name|Type|#LOCs|#SourceFiles|#Endpoints|Language(s)|Runtime|Build Tool|Database(s)|\n") |
| 25 | + cat("|----|----|----:|-----------:|---------:|-----------|-------|----------|-----------|\n") |
| 26 | + |
| 27 | + for (i in 1:nrow(dt)){ |
| 28 | + |
| 29 | + row = dt[i,] |
| 30 | + cat("|__",row$NAME,"__|",sep="") |
| 31 | + |
| 32 | + cat(row$TYPE,"|",sep="") |
| 33 | + cat(row$LOCS,"|",sep="") |
| 34 | + cat(row$FILES,"|",sep="") |
| 35 | + cat(row$ENDPOINTS,"|",sep="") |
| 36 | + cat(handleMultiValues(row$LANGUAGE),"|",sep="") |
| 37 | + cat(row$RUNTIME,"|",sep="") |
| 38 | + cat(row$BUILD,"|",sep="") |
| 39 | + cat(handleMultiValues(row$DATABASE),"|",sep="") |
| 40 | + cat("\n") |
| 41 | + } |
| 42 | + |
| 43 | + sink() |
| 44 | +} |
| 45 | + |
| 46 | + |
5 | 47 | oldLatexTable <- function(){ |
6 | 48 |
|
7 | 49 | dt <- read.csv(DATA_FILE,header=T) |
8 | 50 |
|
9 | 51 | dt = dt[order(dt$TYPE, dt$LANGUAGE, -dt$LOCS, dt$NAME),] |
10 | 52 |
|
11 | | - TABLE = "./statistics_table_emb.tex" |
| 53 | + TABLE = "./old_statistics_table_emb.tex" |
12 | 54 | unlink(TABLE) |
13 | 55 | sink(TABLE, append = TRUE, split = TRUE) |
14 | 56 |
|
|
0 commit comments