# # - eval = FALSE --------------------------------------------------------------- # reposRoot < -“路径/ / reposRoot”# # #的名字是必不可少的# contribPaths < - c(源=“src /普通发布版”,# win.binary =“bin / windows / contrib / 4.0”,# mac.binary = " bin / macosx / contrib / 4.0 ") ## ---- eval = FALSE --------------------------------------------------------------- # extractVignettes (reposRootcontribPaths(“源 "]) ## ---- eval = FALSE --------------------------------------------------------------- # genReposControlFiles (reposRoot contribPaths) # # - eval = FALSE --------------------------------------------------------------- # ## 这样的定义类为每个逻辑文档块# setClass(“pdAuthorMaintainerInfo”,包含=“PackageDetail”)# setClass(“pdVignetteInfo”,包含=“PackageDetail”)# # #然后定义htmlValue方法# setMethod(“htmlValue”,signature(object="pdDescriptionInfo"), # function(object) {# node <- xmlNode("p", cleanText(object@Description), # attrs=c(class="description")) # node #})# # # #假设对象包含一个PackageDetail实例authorInfo <——(对象,“pdAuthorMaintainerInfo”)# dom addNode (htmlValue (authorInfo美元 )) ## ---- eval = FALSE --------------------------------------------------------------- # < -详细信息列表(列表标题=(=“h3标签、文本=“细节”),#内容=“pdDetailsInfo”)#下载< -列表(列表标题=(=“h3标签、文本=“下载包”),#内容=“pdDownloadInfo”)#小插曲< -列表(列表标题=(= =“h3标签#文本片段(文档)),# content="pdVignetteInfo") # doSection <- function(sec) {# dom$addTag(sec$heading$tag, sec$heading$text) # secObj <- as(object, sec$content) # dom$addNode(htmlValue(secObj)) #} # lapply(list(details, downloads, vignettes), doSection)