Skip to content

Commit 10e4a08

Browse files
author
hornik
committed
More helpers.
git-svn-id: https://svn.r-project.org/R/trunk@87500 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 4ef93be commit 10e4a08

File tree

1 file changed

+43
-0
lines changed
  • src/library/tools/R

1 file changed

+43
-0
lines changed

src/library/tools/R/Rd.R

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,27 @@ function()
11411141
aliases
11421142
}
11431143

1144+
### * base_keyword_db
1145+
1146+
## <FIXME>
1147+
## Basically the same as base_aliases_db(): ideally we'd have a common
1148+
## code base so that we can easily add base_concept_db().
1149+
base_keyword_db <-
1150+
function()
1151+
{
1152+
packages <- .get_standard_package_names()$base
1153+
keywords <-
1154+
lapply(packages,
1155+
function(p) {
1156+
db <- Rd_db(p, lib.loc = .Library)
1157+
keywords <- lapply(db, .Rd_get_metadata, "keyword")
1158+
keywords
1159+
})
1160+
names(keywords) <- packages
1161+
keywords
1162+
}
1163+
## </FIXME>
1164+
11441165
### * base_rdxrefs_db
11451166

11461167
base_rdxrefs_db <-
@@ -1210,6 +1231,28 @@ function(x)
12101231
y
12111232
}
12121233

1234+
### * .Rd_keyword_db_to_data_frame
1235+
1236+
## <FIXME>
1237+
## Basically the same as .Rd_aliases_db_to_data_frame(): ideally we'd
1238+
## have a common code base so that we can easily add
1239+
## .Rd_concept_db_to_data_frame().
1240+
## Or have .Rd_metadata_db_to_data_frame(x, kind) ...
1241+
.Rd_keyword_db_to_data_frame <-
1242+
function(x)
1243+
{
1244+
wrk <- function(a, p) {
1245+
cbind(unlist(a, use.names = FALSE),
1246+
rep.int(paste0(p, "::", names(a)), lengths(a)))
1247+
}
1248+
x <- Filter(length, x)
1249+
y <- as.data.frame(do.call(rbind,
1250+
Map(wrk, x, names(x), USE.NAMES = FALSE)))
1251+
colnames(y) <- c("Keyword", "Source")
1252+
y
1253+
}
1254+
## </FIXME>
1255+
12131256
### * .Rd_rdxrefs_db_to_data_frame
12141257

12151258
.Rd_rdxrefs_db_to_data_frame <-

0 commit comments

Comments
 (0)