├── .gitignore ├── DESCRIPTION ├── NAMESPACE ├── R ├── changelog.r ├── demo.r ├── evaluate.r ├── functions.r ├── history.r ├── index.r ├── local.r ├── package.r ├── packages.r ├── parse-rd.r ├── pictures.r ├── render.r ├── route.r ├── server_com.r ├── solr-com.r ├── solr-query.r ├── solr-save.r ├── solr.r └── topic.r ├── README.md ├── TODO ├── ideas.md ├── inst ├── public │ ├── .gitignore │ ├── _images │ │ ├── Metamarkets.png │ │ ├── Revolution_Analytics.png │ │ ├── busy.gif │ │ ├── delete.gif │ │ ├── mozilla_blu.gif │ │ ├── ui-icons_000000_256x240.png │ │ ├── ui-icons_222222_256x240.png │ │ ├── ui-icons_444444_256x240.png │ │ ├── ui-icons_cccccc_256x240.png │ │ └── ui-icons_ffffff_256x240.png │ ├── _scripts │ │ ├── jquery-latest.js │ │ ├── jquery.blockUI.js │ │ ├── jquery.highlight-3.yui.js │ │ ├── jquery.masonry.min.js │ │ ├── jquery.parss.js │ │ ├── jquery.quicksearch.js │ │ ├── notification.js │ │ ├── old_packs.js │ │ ├── out.js │ │ ├── rss.js │ │ └── ui.achtung-min.js │ ├── _styles │ │ ├── r-help.css │ │ ├── reset-fonts.css │ │ └── ui.achtung-min.css │ ├── _tmp_pictures │ │ └── .png │ └── favicon.ico └── views │ ├── _analytics.html │ ├── _changelogs.html │ ├── _changelogs_topic_source.html │ ├── _disqus.html │ ├── _facebook.html │ ├── _footer.html │ ├── _function_list.html │ ├── _google_dynamic_feed.html │ ├── _growl.html │ ├── _html_header.html │ ├── _next_previous.html │ ├── _next_previous_in_table.html │ ├── _package_topic_desc.html │ ├── _rating.html │ ├── _search_bar.html │ ├── _top_functions.html │ ├── demo.html │ ├── help.html │ ├── index.html │ ├── package.html │ ├── search.html │ ├── source.html │ ├── topic.html │ └── whistle.html ├── man ├── add_function_links_into_parsed.Rd ├── add_package_link_to_string.Rd ├── author_email.Rd ├── base_html_path.Rd ├── body_text.Rd ├── check_for_package.Rd ├── code_info.Rd ├── dataframe_has_rows.Rd ├── demo_info.Rd ├── demo_src.Rd ├── demo_src_file.Rd ├── eval_on_global.Rd ├── eval_tag_output.Rd ├── evaluate_text.Rd ├── exec_pkg_demo.Rd ├── first_item_pos.Rd ├── function_and_link.Rd ├── function_help_path.Rd ├── function_levels.Rd ├── function_news.Rd ├── functions_used.Rd ├── get_function_history.Rd ├── get_manuals.Rd ├── get_servr_query_result.Rd ├── get_solr_query_result.Rd ├── group_int_arr.Rd ├── has_text.Rd ├── helpr.Rd ├── helpr_demo.Rd ├── helpr_function.Rd ├── helpr_home.Rd ├── helpr_package.Rd ├── helpr_path.Rd ├── helpr_render_json.Rd ├── helpr_replay.Rd ├── helpr_solr_search.Rd ├── helpr_topic.Rd ├── highlight.Rd ├── i_can_has_internetz.Rd ├── index_all.Rd ├── index_package.Rd ├── index_topic.Rd ├── install_packages.Rd ├── installed_packages.Rd ├── is_section.Rd ├── last_item_pos.Rd ├── last_ten_functions.Rd ├── list_tags.Rd ├── list_to_double_list.Rd ├── list_to_xml.Rd ├── load_html.Rd ├── local_mode.Rd ├── make_add_xml.Rd ├── make_field.Rd ├── name_rd.Rd ├── old_package_names.Rd ├── package_and_topic_from_url.Rd ├── package_description.Rd ├── parse_help.Rd ├── parse_item_list.Rd ├── parse_items.Rd ├── parse_pkg_desc_item.Rd ├── parse_tabular.Rd ├── parse_text.Rd ├── parse_usage.Rd ├── pkg_and_topic_from_help_url.Rd ├── pkg_author_and_maintainers.Rd ├── pkg_demos.Rd ├── pkg_help_path.Rd ├── pkg_news.Rd ├── pkg_rddb_path.Rd ├── pkg_topic.Rd ├── pkg_topics_alias.Rd ├── pkg_topics_index.Rd ├── pkg_topics_rd.Rd ├── pkg_version.Rd ├── pkg_vigs.Rd ├── pluralize.Rd ├── print.help_files_with_topic.Rd ├── print.packageInfo.Rd ├── put_file.Rd ├── put_string.Rd ├── read_rds.Rd ├── read_url.Rd ├── reconstruct.Rd ├── render_snippet.Rd ├── rp.Rd ├── safely_order_funcs.Rd ├── save_picture.Rd ├── save_xml.Rd ├── search_query_path.Rd ├── send_commit_command.Rd ├── send_system_command.Rd ├── servr_base_url.Rd ├── servr_combine_param.Rd ├── servr_has_topic_in_example.Rd ├── servr_similar.Rd ├── simple_tags.Rd ├── solr_base_url.Rd ├── solr_combine_param.Rd ├── solr_delete_package.Rd ├── solr_example_field.Rd ├── solr_has_topic_in_example.Rd ├── solr_query_example_field.Rd ├── solr_query_topic_fields.Rd ├── solr_similar.Rd ├── solr_topic.Rd ├── solr_topic_fields.Rd ├── strip_html.Rd ├── strong.Rd ├── tag.Rd ├── tag_link.Rd ├── tag_simple.Rd ├── ten_functions.Rd ├── top_ten_functions.Rd ├── topic_is_internal.Rd ├── untag.Rd ├── update_packs.Rd ├── urlJSON_to_list.Rd ├── usage_functions.Rd └── usage_methods.Rd └── not-used └── crantastic.r /.gitignore: -------------------------------------------------------------------------------- 1 | man/Not-Documented/ 2 | 3 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: helpr 2 | Type: Package 3 | Title: Help for R. 4 | Version: 0.2.0 5 | Author: Hadley Wickham and Barret 6 | Schloerke 7 | Maintainer: Barret Schloerke 8 | Description: Better html documentation for R 9 | Depends: 10 | tools 11 | Imports: 12 | base, 13 | brew, 14 | rjson, 15 | memoise, 16 | sinartra (>= 0.3), 17 | evaluate, 18 | highlight, 19 | digest, 20 | parser, 21 | stringr (>= 0.4), 22 | stats, 23 | utils 24 | License: GPL-2 25 | LazyData: true 26 | Collate: 27 | 'changelog.r' 28 | 'demo.r' 29 | 'evaluate.r' 30 | 'functions.r' 31 | 'history.r' 32 | 'index.r' 33 | 'local.r' 34 | 'package.r' 35 | 'packages.r' 36 | 'parse-rd.r' 37 | 'pictures.r' 38 | 'render.r' 39 | 'route.r' 40 | 'server_com.r' 41 | 'solr-com.r' 42 | 'solr-query.r' 43 | 'solr-save.r' 44 | 'solr.r' 45 | 'topic.r' 46 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | export(helpr) 2 | export(load_html) 3 | import(memoise) 4 | import(parser) 5 | import(sinartra) 6 | import(stats) 7 | import(stringr) 8 | import(tools) 9 | import(utils) 10 | importFrom(highlight,highlight) 11 | importFrom(highlight,renderer_html) 12 | S3method(print,help_files_with_topic) 13 | -------------------------------------------------------------------------------- /R/changelog.r: -------------------------------------------------------------------------------- 1 | #' Package news. 2 | #' 3 | #' @param package package name 4 | #' @author Barret Schloerke 5 | #' @keywords internal 6 | pkg_news <- function(package) { 7 | package_news <- tryCatch( 8 | news(package = package), 9 | error = function(e) 10 | NULL) 11 | if (is.null(package_news)) return(NULL) 12 | 13 | # retain only the latest version infomation 14 | latest <- package_news$Version[1] 15 | package_news <- package_news[package_news$Version %in% latest, ] 16 | 17 | list( 18 | title = "Change Log", 19 | date = unique(package_news$Version), 20 | news = split(package_news$Text, addNA(package_news$Category)) 21 | ) 22 | } 23 | 24 | #' Function news. 25 | #' 26 | #' @author Barret Schloerke 27 | #' @param package package name 28 | #' @param topic demo name 29 | #' @keywords internal 30 | function_news <- function(package, topic) { 31 | package_news <- news(package = package) 32 | if (is.null(package_news)) return(NULL) 33 | 34 | # retain only the infomation that contains the topic name 35 | package_news <- package_news[str_detect(package_news$Text, topic), ] 36 | if (!dataframe_has_rows(package_news)) return(NULL) 37 | 38 | package_news$title <- str_c(package_news$Version, " - ", package_news$Category) 39 | 40 | list( 41 | title = str_c("Change Log for '", topic, "'", collapse = ""), 42 | news = split(package_news$Text, addNA(package_news$title)) 43 | ) 44 | } 45 | 46 | 47 | 48 | #' Locate all R manuals on the local computer. 49 | #' 50 | #' @keywords internal 51 | #' @author Barret Schloerke 52 | get_manuals <- memoise(function() { 53 | # get files in the manual directory with full path 54 | manual_dir <- file.path(Sys.getenv("R_DOC_DIR"), "manual") 55 | manuals <- dir(manual_dir) 56 | 57 | file_loc <- file.path(manual_dir, manuals) 58 | file_name <- str_replace_all(manuals, ".html", "") 59 | link <- str_c("/manuals/", file_name, ".html") 60 | 61 | if(identical(link, "/manuals/.html")) 62 | link <- character(0) 63 | 64 | data.frame( 65 | title = sapply(file_loc, function(x) { 66 | strip_html(readLines(x, 3)[3]) 67 | }), 68 | file_loc = file_loc, 69 | link = link, 70 | file_name = file_name, 71 | stringsAsFactors = FALSE 72 | ) 73 | }) 74 | -------------------------------------------------------------------------------- /R/demo.r: -------------------------------------------------------------------------------- 1 | #' Demo source file. 2 | #' 3 | #' @param package package name 4 | #' @param demo_name demo name 5 | #' @return "" if the demo is not found for that package, file.path if the demo folder is found 6 | #' @author Barret Schloerke 7 | #' @keywords internal 8 | demo_src_file <- function(package, demo_name) { 9 | system.file("demo", str_c(demo_name, ".R"), package = package) 10 | } 11 | 12 | #' Demo information. 13 | #' 14 | #' @param package package name 15 | #' @param demo_name demo name 16 | #' @return demo() information for the \code{demo_name} in \code{package} 17 | #' @author Barret Schloerke 18 | #' @keywords internal 19 | demo_info <- function(package, demo_name) { 20 | subset(pkg_demos(package), Item == demo_name) 21 | } 22 | 23 | #' helpr demo information. 24 | #' 25 | #' @param package package name 26 | #' @param demo_name demo name 27 | #' @keywords internal 28 | #' @import parser 29 | helpr_demo <- function(package, demo_name) { 30 | info <- demo_info(package, demo_name) 31 | 32 | parsed_src <- parser::parser(file = demo_src_file(package, demo_name)) 33 | 34 | demo_functions <- code_info(parsed_src) 35 | other_demos <- suppressWarnings(subset(as.data.frame(pkg_demos(package)), Item != demo_name)) 36 | 37 | demo_src_c <- demo_src(package, demo_name) 38 | 39 | list( 40 | package = package, 41 | name = demo_name, 42 | description = info[1, "Title"], 43 | src = highlight(parsed_src), 44 | other_demos = other_demos, 45 | other_demos_str = pluralize("Demo", other_demos), 46 | src_functions = demo_functions, 47 | src_functions_str = pluralize("Top Function", demo_functions) 48 | ) 49 | } 50 | 51 | #' Demo source. 52 | #' 53 | #' @param package package name 54 | #' @param demo_name demo name 55 | #' @return source for the demo 56 | #' @author Barret Schloerke 57 | #' @keywords internal 58 | demo_src <- function(package, demo_name){ 59 | demo_lines <- readLines(demo_src_file(package, demo_name)) 60 | rows <- str_detect(demo_lines, "example[[:space:]]*\\(") 61 | demo_lines[rows] <- str_c("# ", demo_lines[rows]) 62 | str_c(demo_lines, collapse = "\n") 63 | } 64 | 65 | 66 | #' List all demos in a package. 67 | #' 68 | #' @param package package name 69 | #' @return demo() information for the \code{demo_name} in \code{package} 70 | #' @author Barret Schloerke 71 | #' @keywords internal 72 | pkg_demos <- function(package) { 73 | as.data.frame(demo(package = package)$results, stringsAsFactors = FALSE) 74 | } 75 | -------------------------------------------------------------------------------- /R/evaluate.r: -------------------------------------------------------------------------------- 1 | #' Replay a list of evaluated results, just like you'd run them in a R 2 | #' terminal. 3 | #' 4 | #' @param x result from \code{\link{evaluate}} 5 | #' @param pic_base_name base picture name to be used 6 | #' @author Barret Schloerke 7 | #' @keywords internal 8 | #' @import parser 9 | helpr_replay <- function(x, pic_base_name) UseMethod("helpr_replay", x) 10 | 11 | helpr_replay.list <- function(x, pic_base_name) { 12 | lapply(seq_along(x), function(i, base_name = pic_base_name) { 13 | item <- x[[i]] 14 | item_name <- str_c(base_name, "_", i, collapse = "") 15 | helpr_replay(item, item_name) 16 | }) 17 | } 18 | 19 | helpr_replay.character <- function(x, pic_base_name) { 20 | eval_tag_output(x) 21 | } 22 | 23 | helpr_replay.source <- function(x, pic_base_name) { 24 | if (str_trim(x$src) == "") return(x$src) 25 | 26 | parsed <- parser::parser(text = x$src) 27 | highlight(parsed) 28 | } 29 | 30 | helpr_replay.warning <- function(x, pic_base_name) { 31 | strong(str_c("Warning message:\n", x$message, collapse = "")) 32 | } 33 | 34 | helpr_replay.message <- function(x, pic_base_name) { 35 | strong(gsub("\n$", "", x$message)) 36 | } 37 | 38 | helpr_replay.error <- function(x, pic_base_name) { 39 | if (is.null(x$call)) { 40 | strong(str_c("Error: ", x$message, collapse = "\n")) 41 | } else { 42 | call <- deparse(x$call) 43 | strong(str_c("Error in ", call, ": ", x$message, collapse = "\n")) 44 | } 45 | } 46 | 47 | helpr_replay.value <- function(x, pic_base_name) { 48 | if (x$visible) eval_tag_output(str_c(capture.output(print(x$value)), collapse = "\n")) 49 | } 50 | 51 | helpr_replay.recordedplot <- function(x, pic_base_name) { 52 | file_loc <- save_picture(pic_base_name, x) 53 | str_c("\"",", collapse = "") 54 | } 55 | 56 | #' Strong HTML 57 | #' 58 | #' @author Barret Schloerke 59 | #' @keywords internal 60 | strong <- function(x) { 61 | eval_tag_output(str_c("\n",x,"")) 62 | } 63 | 64 | 65 | #' Eval text using the global environment. 66 | #' Using memoise to speedup reproducability. 67 | #' 68 | #' @param txt text to be evaluated 69 | #' @author Barret Schloerke 70 | #' @keywords internal 71 | #' importFrom evaluate evaluate 72 | eval_on_global <- memoise(function(txt) { 73 | evaluate:::evaluate(txt, globalenv()) 74 | }) 75 | 76 | #' Evaluate text and return the corresponding text output and source. 77 | #' 78 | #' @param txt text to be evaluated 79 | #' @param pic_base_name base name for the picture files 80 | #' @author Barret Schloerke 81 | #' @keywords internal 82 | evaluate_text <- function(txt, pic_base_name) { 83 | if (!has_text(txt)) return("") 84 | 85 | evaluated <- eval_on_global(txt) 86 | replayed <- helpr_replay(evaluated, pic_base_name) 87 | str_c(as.character(unlist(replayed)), collapse = "\n") 88 | } 89 | 90 | #' Tag the output text with correct css class 91 | #' 92 | #' @author Barret Schloerke 93 | #' @keywords internal 94 | eval_tag_output <- function(x) { 95 | str_c("
", x, "
") 96 | } 97 | 98 | #' Evaluate demo in the R console. 99 | #' 100 | #' @param package package in question 101 | #' @param dem demo in question 102 | #' @author Barret Schloerke 103 | #' @keywords internal 104 | exec_pkg_demo <- function(package, dem) { 105 | demo(dem, character = TRUE, package = package, ask = TRUE) 106 | } 107 | 108 | -------------------------------------------------------------------------------- /R/functions.r: -------------------------------------------------------------------------------- 1 | #' Extract source code of a function. 2 | #' 3 | #' @param fun name of function to get the source code from 4 | #' @return NULL or source code of of the function 5 | #' @author Barret Schloerke \email{schloerke@@gmail.con} and Hadley Wickham 6 | #' @keywords internal 7 | body_text <- function(package, fun) { 8 | text <- tryCatch( 9 | get(fun, mode = "function"), 10 | error = function(e) { 11 | tryCatch( 12 | get(fun, mode = "function", envir = asNamespace(package)), 13 | error = function(e) 14 | stop("can't find the function ", fun) 15 | ) 16 | } 17 | ) 18 | 19 | if (is.null(text)) { 20 | NULL 21 | } else { 22 | str_c(deparse(text), collapse = "\n") 23 | } 24 | } 25 | 26 | 27 | #' Return the package functions and links of a given text. 28 | #' 29 | #' @param parser_output text that has been parsed 30 | #' @author Barret Schloerke 31 | #' @keywords internal 32 | function_and_link <- function(parser_output) { 33 | parsed_funcs <- as.data.frame(attr(parser_output, "data"), stringsAsFactors = FALSE) 34 | functions <- subset(parsed_funcs, token.desc %in% c("SYMBOL_FUNCTION_CALL", "NULL_CONST"))$text 35 | 36 | paths <- function_help_path(functions) 37 | 38 | funcs_and_paths <- as.data.frame(list(functions = functions, paths = paths), stringsAsFactors = FALSE) 39 | 40 | funcs_and_paths[complete.cases(funcs_and_paths), ] 41 | } 42 | 43 | #' Retrieve the package and the topic from a url that contains both. 44 | #' 45 | #' @param url_string url in question 46 | #' @author Barret Schloerke 47 | #' @keywords internal 48 | pkg_and_topic_from_help_url <- function(url_string) { 49 | rev(rev(str_split(url_string, .Platform$file.sep)[[1]])[1:3])[c(1, 3)] 50 | } 51 | 52 | #' Return the help path of a function. 53 | #' 54 | #' @param x item to find the help path 55 | #' @param source_link boolean to determine whether or not it is linking to the source or topic page 56 | #' @author Barret Schloerke 57 | #' @keywords internal 58 | #' @aliases function_help_path function_help_path_mem 59 | function_help_path <- function(func, source_link = FALSE) { 60 | sapply(func, function_help_path_mem, source_link = source_link) 61 | } 62 | 63 | function_help_path_mem <- memoise(function(x, source_link = FALSE) { 64 | url_string <- help(x)[1] 65 | if (is.na(url_string)) { 66 | NA 67 | } else { 68 | # retrieve last three folders/file and keep the package and topic 69 | pack_and_topic <- pkg_and_topic_from_help_url(url_string) 70 | 71 | ending <- str_c("/topic/", x) 72 | if (source_link) 73 | ending <- str_c(ending, "/source") 74 | str_c("/package/", pack_and_topic[1], ending) 75 | } 76 | }) 77 | 78 | 79 | 80 | #' Find functions, counts, and links of given R text. 81 | #' 82 | #' @param parser_output text that has been parsed 83 | #' @return data.frame containing the name, count and link of each function 84 | #' within the text 85 | #' @author Barret Schloerke 86 | #' @keywords internal 87 | code_info <- function(parser_output) { 88 | if (is.null(parser_output)) 89 | return(data.frame()) 90 | 91 | funcs_and_paths <- function_and_link(parser_output) 92 | if (!dataframe_has_rows(funcs_and_paths)) 93 | return(data.frame()) 94 | 95 | funcs <- table(funcs_and_paths$functions) 96 | order <- order(funcs, decreasing = TRUE) 97 | 98 | uni_funs <- unique(funcs_and_paths) 99 | 100 | # order the outputs the same 101 | funcs <- funcs[order] 102 | 103 | # make alphabetical to match table output 104 | uni_funs <- uni_funs[order(uni_funs$functions)[order], ] 105 | 106 | name_count_link <- data.frame( 107 | name = uni_funs$functions, 108 | count = funcs, 109 | link = uni_funs$paths 110 | ) 111 | 112 | name_count_link <- subset(name_count_link, count > 1) 113 | 114 | rows <- NROW(name_count_link) 115 | if(rows > 10) { 116 | rows <- 10 117 | } else if(rows > 5) { 118 | rows <- 5 119 | } 120 | 121 | name_count_link[seq_len(rows), ] 122 | } 123 | 124 | 125 | #' Render all the information to display a topic source page. 126 | #' 127 | #' @param package package in question 128 | #' @param func function in question 129 | #' @author Barret Schloerke 130 | #' @keywords internal 131 | helpr_function <- function(package, func) { 132 | 133 | index <- pkg_topics_index(package) 134 | topic <- as.character(subset(index, alias == func, "file")) 135 | aliases <- subset(index, (file == topic) & (alias != func), "alias") 136 | 137 | par_text <- tryCatch( 138 | parse_text(reconstruct(body_text(package, func), package)), 139 | error = function(e){ 140 | "bad_function" 141 | } 142 | ) 143 | 144 | if (identical(par_text, "bad_function")) { 145 | 146 | input <- str_c("str(", func, ")", collapse = "") 147 | src <- capture.output(eval(parser(text = input)[1])) 148 | src <- str_replace_all(src, "<", "<") 149 | src <- str_replace_all(src, ">", ">") 150 | src <- eval_tag_output(str_c(src, collapse = "\n")) 151 | src <- str_c("
", input,"
", src) 152 | src_functions <- NULL 153 | src_functions_str <- "" 154 | 155 | } else { 156 | src_functions <- code_info(par_text) 157 | src <- highlight(par_text) 158 | src_functions_str <- pluralize("Top Function", src_functions) 159 | } 160 | 161 | list( 162 | package = package, 163 | topic = topic, 164 | name = func, 165 | aliases = aliases, 166 | aliases_str = pluralize("Topic (Source)", aliases, plural="Topics (Source)"), 167 | desc = gsub("$\n+|\n+^", "", reconstruct(pkg_topic(package, topic)$description, package)), 168 | src = src, 169 | src_functions = src_functions, 170 | src_functions_str = src_functions_str, 171 | change_log = function_news(package, topic), 172 | topic_in_example = solr_has_topic_in_example(topic) 173 | ) 174 | } 175 | 176 | 177 | 178 | 179 | -------------------------------------------------------------------------------- /R/history.r: -------------------------------------------------------------------------------- 1 | #' List all recently called functions. 2 | #' 3 | #' @return fuctions that are from a package 4 | #' @author Barret Schloerke 5 | #' @keywords internal 6 | get_function_history <- function() { 7 | rawhist <- NULL 8 | a <- NULL 9 | pattern <- "[a-zA-Z_.][a-zA-Z_.0-9]*\\(" 10 | file1 <- tempfile("Rrawhist") 11 | savehistory(file1) 12 | rawhist <- readLines(file1) 13 | unlink(file1) 14 | 15 | # subset then find function names 16 | rawhist <- grep(pattern, rawhist, value = TRUE ) 17 | funcs <- unlist(str_extract_all(rawhist, pattern)) 18 | funcs <- funcs[ ! funcs %in% c("if(", "for(", "while(", "get_function_history(")] 19 | funcs <- str_replace_all(funcs, "[(]", "") 20 | 21 | funcs 22 | } 23 | 24 | 25 | #' List last ten unique functions called from the command line. 26 | #' 27 | #' @param fun_list function list 28 | #' @author Barret Schloerke 29 | #' @keywords internal 30 | #' @return fuctions that are from a package and their help paths 31 | last_ten_functions <- function(fun_list = get_function_history()) { 32 | unique_fun_list <- unique(rev(fun_list)) 33 | if(NROW(unique_fun_list) < 1) return(NULL) 34 | 35 | last_ten_funcs <- data.frame( 36 | func = unique_fun_list, 37 | path = function_help_path(unique_fun_list), 38 | stringsAsFactors = FALSE 39 | ) 40 | last_ten_funcs <- subset( last_ten_funcs, !is.na(path)) 41 | last_ten <- min(10, NROW(last_ten_funcs)) 42 | 43 | last_ten_funcs[seq_len(last_ten), ] 44 | } 45 | 46 | #' List top 10 most frequently called functions. 47 | #' 48 | #' @param fun_list function list 49 | #' @return fuctions that are from a package and their help paths 50 | #' @author Barret Schloerke 51 | #' @keywords internal 52 | top_ten_functions <- function(fun_list = get_function_history()) { 53 | if(NROW(fun_list) < 1) return(NULL) 54 | func_count <- table(fun_list) 55 | 56 | func_count <- func_count[order(func_count, decreasing = TRUE)] 57 | 58 | func_name <- names(func_count) 59 | 60 | top_ten_funcs <- subset( 61 | data.frame( 62 | func = func_name, 63 | path = function_help_path(func_name), 64 | stringsAsFactors = FALSE 65 | ), 66 | !is.na(path) 67 | ) 68 | 69 | top_ten <- min(10, NROW(top_ten_funcs)) 70 | top_ten_funcs[seq_len(top_ten), ] 71 | } 72 | 73 | 74 | #' Both the top ten most called and last ten functions. 75 | #' 76 | #' @return list containing the \code{\link{top_ten_functions}} and \code{\link{last_ten_functions}} 77 | #' @author Barret Schloerke 78 | #' @keywords internal 79 | ten_functions <- function() { 80 | fun_hist <- tryCatch( 81 | get_function_history(), 82 | error = function(e) data.frame() 83 | ) 84 | 85 | list( 86 | last_ten = last_ten_functions(fun_hist), 87 | top_ten = top_ten_functions(fun_hist) 88 | ) 89 | } 90 | -------------------------------------------------------------------------------- /R/index.r: -------------------------------------------------------------------------------- 1 | #' Make Helpr topic into xml for solr. 2 | #' 3 | #' @param package package to use 4 | #' @param topic topic to explore 5 | #' @author Barret Schloerke 6 | #' @keywords internal 7 | solr_topic <- function(package, topic) { 8 | 9 | rd <- pkg_topic(package, topic) 10 | tags <- sapply(rd, tag) 11 | 12 | # Remove top-level text strings - just line breaks between sections 13 | rd <- rd[tags != "TEXT"] 14 | 15 | out <- list() 16 | 17 | # Join together aliases and keywords 18 | out$Aliases <- setdiff( 19 | unname(sapply(rd[names(rd) == "alias"], "[[", 1)), 20 | strip_html(reconstruct(untag(rd$name), package)) 21 | ) 22 | out$Keywords <- unname(sapply(rd[names(rd) == "keyword"], "[[", 1)) 23 | 24 | # Title, description, value and examples, need to be stitched into a 25 | # single string. 26 | out$Title <- strip_html(reconstruct(untag(rd$title), package)) 27 | out$Description <- gsub("$\n+|\n+^", "", strip_html(reconstruct(rd$description, package))) 28 | out$Details <- strip_html(reconstruct(rd$details, package)) 29 | out$Value <- strip_html(reconstruct(rd$value, package)) 30 | out$Authors <- strip_html(reconstruct(rd$author, package)) 31 | out$Package <- str_c(package, " (", pkg_version(package), ")", collapse = "") 32 | out$Examples <- functions_used(reconstruct(untag(rd$examples), package)) 33 | 34 | list_to_xml( 35 | str_c("/package/", package, "/topic/", topic, collapse = ""), 36 | out 37 | ) 38 | } 39 | 40 | #' Index topic. 41 | #' Index a topic into solr 42 | #' 43 | #' @author Barret Schloerke 44 | #' @param package package in question 45 | #' @param topic topic in question 46 | index_topic <- function(package, topic) { 47 | if (! i_can_has_internetz()) return(NULL) 48 | 49 | put_string(make_add_xml(solr_topic(package, topic))) 50 | } 51 | 52 | 53 | #' Index package. 54 | #' Index a whole package into solr 55 | #' 56 | #' @author Barret Schloerke 57 | #' @param package package in question 58 | #' @param start_letter used when you want to start froma certain letter, such as 'q' 59 | #' @param verbose should output be shown? 60 | index_package <- function(package, start_letter = "a", verbose = TRUE) { 61 | if (! i_can_has_internetz()) return(NULL); 62 | 63 | if (verbose == TRUE) cat("\n\n\n") 64 | if (verbose == TRUE || verbose == "package") cat(package,"\n") 65 | 66 | # require(package, character.only=TRUE) 67 | 68 | all_topics <- pkg_topics_index(package) 69 | unique_topics <- all_topics[!duplicated(all_topics$file), "alias"] 70 | 71 | if (length(unique_topics) > 0) { 72 | first_letter <- sapply(strsplit(unique_topics, ""), function(x) {tolower(x[1])}) 73 | rows <- str_detect(first_letter, str_c("[", tolower(start_letter), "-z]")) 74 | unique_topics <- unique_topics[rows] 75 | } 76 | 77 | pkg_output <- c() 78 | for (i in seq_along(unique_topics)) { 79 | if (verbose==TRUE) cat(i,": ", unique_topics[i],"... ") 80 | start_time <- Sys.time() 81 | pkg_output[i] <- solr_topic(package, unique_topics[i]) 82 | time <- Sys.time() - start_time 83 | if (verbose==TRUE) cat(" ", str_sub(capture.output(time), 20), "\n") 84 | } 85 | 86 | # delete all previous information 87 | solr_delete_package(package) 88 | 89 | # add new information 90 | put_string( 91 | make_add_xml( 92 | str_c( 93 | "\n\n\n\n", 94 | str_c(pkg_output, collapse = "\n\n"), 95 | collapse = "") 96 | ) 97 | ) 98 | 99 | } 100 | 101 | 102 | #' Index all packages. 103 | #' Index all packages into solr 104 | #' 105 | #' @aliases index_all index_packages 106 | #' @author Barret Schloerke 107 | #' @param start_letter used when you want to start froma certain letter, such as 'q' 108 | #' @param verbose should output be shown? 109 | index_all <- function(start_letter = "a", verbose = TRUE) { 110 | if (! i_can_has_internetz()) return(NULL) 111 | 112 | packages <- installed_packages()$Package 113 | packages <- packages[order(tolower(packages))] 114 | first_letter <- sapply(strsplit(packages, ""), function(x) { tolower(x[1]) }) 115 | rows <- str_detect(first_letter, str_c("[", tolower(start_letter), "-z]")) 116 | packages <- packages[rows] 117 | 118 | result <- index_packages(packages) 119 | 120 | if (verbose) cat("Finished\n") 121 | result 122 | } 123 | index_packages <- function(arr, verbose = TRUE) { 124 | sapply(arr, function(x) { 125 | tryCatch( 126 | index_package(x, verbose = verbose), 127 | error = function(e) { 128 | "failure" 129 | } 130 | ) 131 | }) 132 | } -------------------------------------------------------------------------------- /R/local.r: -------------------------------------------------------------------------------- 1 | #' Local Mode 2 | #' 3 | #' @author Barret Schloerke 4 | #' @aliases local_mode activate_internetz deactivate_internetz allow_internetz 5 | #' @keywords internal 6 | local_mode <- local({ 7 | internetz <- TRUE 8 | deactivate_internetz <- function() internetz <<- FALSE 9 | activate_internetz <- function() internetz <<- TRUE 10 | allow_internetz <- function() internetz 11 | 12 | list( 13 | activate_internetz = activate_internetz, 14 | deactivate_internetz = deactivate_internetz, 15 | allow_internetz = allow_internetz 16 | ) 17 | }) 18 | activate_internetz <- local_mode$activate_internetz 19 | deactivate_internetz <- local_mode$deactivate_internetz 20 | allow_internetz <- local_mode$allow_internetz 21 | 22 | 23 | 24 | 25 | 26 | #' Router Info 27 | #' 28 | #' @author Barret Schloerke 29 | #' @aliases rp set_router_info set_fouter_file_path set_router_custom_route router_info fouter_file_path router_custom_route 30 | #' @keywords internal 31 | rp <- local({ 32 | url_path <- "" 33 | file_pathP <- getwd() 34 | custom <- FALSE 35 | 36 | set_url <- function(val) url_path <<- val 37 | set_file_path <- function(val) file_pathP <<- val 38 | set_custom_router <- function(val) custom <<- val 39 | 40 | url <- function() url_path 41 | file_path <- function() file_pathP 42 | custom_router <- function() custom 43 | 44 | list( 45 | set_url = set_url, 46 | set_file_path = set_file_path, 47 | set_custom_router = set_custom_router, 48 | 49 | url = url, 50 | file_path = file_path, 51 | custom_router = custom_router 52 | ) 53 | }) 54 | set_router_url <- rp$set_url 55 | set_router_file_path <- rp$set_file_path 56 | set_router_custom_route <- rp$set_custom_router 57 | router_url <- rp$url 58 | router_file_path <- rp$file_path 59 | router_custom_route <- rp$custom_router 60 | 61 | 62 | -------------------------------------------------------------------------------- /R/packages.r: -------------------------------------------------------------------------------- 1 | #' Installed packages. 2 | #' 3 | #' Runs about 10x faster than \code{\link{installed.packages}} 4 | #' @return a list of packages 5 | #' @keywords internal 6 | #' @author Hadley Wickham 7 | installed_packages <- function() { 8 | user_libPaths <- normalizePath(.libPaths()) 9 | uniqueLibPaths <- subset(user_libPaths, !duplicated(user_libPaths)) 10 | 11 | paths <- unlist(lapply(uniqueLibPaths, dir, full.names = TRUE)) 12 | desc <- file.path(paths, "DESCRIPTION") 13 | desc <- desc[file.exists(desc)] 14 | 15 | dcf <- lapply(desc, read.dcf, fields = c("Package", "Title", "Version")) 16 | packages <- as.data.frame(do.call("rbind", dcf), stringsAsFactors = FALSE) 17 | 18 | packages$status <- ifelse(packages$Package %in% .packages(), "loaded", "installed") 19 | class(packages) <- c("packages", class(packages)) 20 | packages <- packages[order(packages$Package), ] 21 | packages[! duplicated(packages$Package), ] 22 | 23 | } 24 | 25 | 26 | #' Out of date packages. 27 | #' 28 | #' @author Barret Schloerke 29 | #' @keywords internal 30 | old_package_names <- function() { 31 | unname(old.packages()[, "Package"]) 32 | } 33 | 34 | #' Update all packages that are old and currently loaded or installed. 35 | #' 36 | #' @author Barret Schloerke 37 | #' @keywords internal 38 | update_packs <- function(all = FALSE) { 39 | if(all) { 40 | packs <- installed_packages()[,"Package"] 41 | } else { 42 | packs <- .packages() 43 | } 44 | packs <- packs[packs %in% old_package_names()] 45 | install_packages(packs) 46 | as.array(packs) 47 | } 48 | 49 | #' Install packages. 50 | #' update a vector of packages 51 | #' 52 | #' @author Barret Schloerke 53 | #' @keywords internal 54 | install_packages <- function(pkg_vec) { 55 | # message(str_c("installing: ", pkg_vec, collapse = "\n")) 56 | suppressWarnings(install.packages(pkg_vec, repos = "http://cran.r-project.org/")) 57 | } 58 | -------------------------------------------------------------------------------- /R/pictures.r: -------------------------------------------------------------------------------- 1 | #' Save a picture into the temp directory. 2 | #' 3 | #' @return the path to the picture (using the website) 4 | #' @author Barret Schloerke 5 | #' @keywords internal 6 | save_picture <- function(obj_name, obj_plot) { 7 | file_path <- file.path(tempdir(), str_c(obj_name, ".png", collapse = "")) 8 | 9 | # only make the picture if you have to 10 | # duplicates do not exist as naming should be done well 11 | if(!file.exists(file_path)) { 12 | png(file_path) 13 | on.exit(dev.off()) 14 | print(obj_plot) 15 | } 16 | 17 | str_c("/picture/", obj_name, ".png", collapse = "") 18 | } 19 | -------------------------------------------------------------------------------- /R/render.r: -------------------------------------------------------------------------------- 1 | #' Render HTML Snippet. 2 | #' 3 | #' @param template name of file to use in the folder "views" 4 | #' @param params list containing objects to be sent to the template 5 | #' @param path path to be used to find the "views" folder 6 | #' @return text rendered from the template 7 | #' @author Barret Schloerke 8 | #' @keywords internal 9 | #' @import sinartra 10 | render_snippet <- function(template, params = NULL, path = router_file_path()) { 11 | template <- str_c("_", template) 12 | render_brew(template, params, path, parent = parent.frame())$payload 13 | } 14 | 15 | 16 | #' Helpr Path: Where's my help at? 17 | #' 18 | #' @return returns the path the to the helpr dir. This could be local or the system (installed) path 19 | #' @keywords internal 20 | #' @examples 21 | #' #if(identical(helpr_path(), getwd())) { 22 | #' # "you are a developer" 23 | #' #} else { 24 | #' # "you have installed helpr" 25 | #' #} 26 | helpr_path <- memoise(function() { 27 | if (all(c("DESCRIPTION", "inst", "man", "R") %in% dir() )) { 28 | if ("helpr" %in% dir("../")) { 29 | return(suppressWarnings(normalizePath(file.path(getwd(), "inst")))) 30 | } 31 | } 32 | system.file(package = "helpr") 33 | }) 34 | -------------------------------------------------------------------------------- /R/server_com.r: -------------------------------------------------------------------------------- 1 | #' Solr base URL. 2 | #' 3 | #' @author Barret Schloerke 4 | #' @keywords internal 5 | servr_base_url <- function() { 6 | # "http://localhost:8983" 7 | "http://helpr32.mmx-dns.com:8080" 8 | } 9 | 10 | 11 | 12 | #' Combine Solr parameters. 13 | #' 14 | #' @author Barret Schloerke 15 | #' @keywords internal 16 | servr_combine_param <- function(value, param = names(value)) { 17 | str_c(param, value, sep = "=", collapse = "&") 18 | } 19 | 20 | 21 | #' Similar pages. 22 | #' Find related pages and return info in a data.frame 23 | #' 24 | #' @param topic title to be used to find similar results 25 | #' @author Barret Schloerke 26 | #' @keywords internal 27 | servr_similar <- function(topic) { 28 | if (! i_can_has_internetz()) return(data.frame()) 29 | 30 | site <- str_c(servr_base_url(), "/solr/select?wt=json&mlt=true&mlt.count=5&mlt.fl=Title_t,Description_t&q=", solr_query_topic_fields(topic)) 31 | output <- suppressWarnings(urlJSON_to_list(site)) 32 | 33 | docs <- output$moreLikeThis[[1]]$docs 34 | 35 | t(sapply(docs, function(x) { 36 | path <- package_and_topic_from_url(x$id) 37 | c(title = x$Title_t, pkg = path$pkg, topic = path$topic) 38 | })) 39 | 40 | } 41 | 42 | 43 | #' Solr Topics in Example 44 | #' 45 | #' @author Barret Schloerke 46 | #' @keywords internal 47 | servr_has_topic_in_example <- function(topics) { 48 | if (! i_can_has_internetz()) return(data.frame()) 49 | 50 | query_list <- list(query = topics) 51 | 52 | result <- get_solr_query_result(query_list, TRUE) 53 | if(result$total_item_count == 0) 54 | return(data.frame()) 55 | 56 | t(sapply(result$response, function(x) { 57 | path <- package_and_topic_from_url(x$id) 58 | c(title = x$Title_t, pkg = path$pkg, topic = path$topic) 59 | })) 60 | } 61 | 62 | 63 | 64 | #' Solr query. 65 | #' Retrieve a solr query 66 | #' 67 | #' @param query_list list that contains the start position, query, and other parameters that are ready to be pasted 68 | #' @author Barret Schloerke 69 | #' @keywords internal 70 | get_servr_query_result <- function(query_list, function_field = FALSE) { 71 | 72 | if(is.null(query_list$query)) 73 | stop("query was not included in the query_list") 74 | 75 | other <- query_list$other 76 | if(is.null(other)) 77 | other <- "" 78 | else 79 | other <- str_c("&", other) 80 | 81 | start_pos <- query_list$start 82 | if(is.null(start_pos)) 83 | start_pos <- 0 84 | 85 | rows <- 20 86 | response <- urlJSON_to_list(str_c(servr_base_url(), "/solr/select/?", 87 | "version=2.2", 88 | "&wt=json", 89 | "&rows=", rows, 90 | "&start=", start_pos, 91 | "&indent=on", 92 | if (identical(function_field, FALSE)) { 93 | str_c("&hl=on", 94 | "&hl.simple.pre=", 95 | "&hl.simple.post=", 96 | "&hl.fragsize=70", 97 | "&hl.mergeContiguous=true", 98 | "&hl.fl=", str_c(solr_topic_fields(), collapse = ","), 99 | "&q=", solr_query_topic_fields(query_list$query)) 100 | } else { 101 | str_c( 102 | "&fl=", solr_example_field(), ",id,Title_t", 103 | "&q=", solr_query_example_field(query_list$query) 104 | ) 105 | } 106 | ,other 107 | )) 108 | 109 | if (identical(function_field, FALSE)) { 110 | docs <- response$highlighting 111 | } else { 112 | docs <- response$response$docs 113 | } 114 | 115 | query <- query_list$query 116 | 117 | start_pos <- as.numeric(response$responseHeader$params$start) 118 | if (is.na(start_pos) || is.null(start_pos)) { 119 | start_pos <- 0 120 | } 121 | total_item_count <- as.numeric(response$response$numFound) 122 | 123 | list( 124 | response = docs, 125 | items_before = start_pos, 126 | items_after = max(0, total_item_count - start_pos - rows), 127 | total_item_count = total_item_count, 128 | query = query 129 | ) 130 | } 131 | 132 | -------------------------------------------------------------------------------- /R/solr-com.r: -------------------------------------------------------------------------------- 1 | #' Read URL. 2 | #' Retrieve the text from a URL 3 | #' 4 | #' @param url_string url to explore 5 | #' @return plain text from that url 6 | #' @author Barret Schloerke 7 | #' @keywords internal 8 | read_url <- function(url_string) { 9 | 10 | url_string <- str_replace_all(url_string, "mmx-dns", "mmxMINUSdns") 11 | url_string <- str_replace_all(url_string, "-", "") 12 | url_string <- str_replace_all(url_string, "mmxMINUSdns", "mmx-dns") 13 | url <- URLencode(url_string) 14 | url_connect <- base::url(url) 15 | on.exit(close(url_connect)) 16 | output <- suppressWarnings(str_c(readLines(url_connect), collapse = "")) 17 | output 18 | } 19 | 20 | #' URL with JSON result to list. 21 | #' 22 | #' @param url_string url that contains a JSON output to be turned into a list 23 | #' @author Barret Schloerke 24 | #' @keywords internal 25 | urlJSON_to_list <- function(url_string) { 26 | fromJSON(read_url(url_string)) 27 | } 28 | 29 | #' Send commit command to Solr 30 | #' Send a commit command to Solr to finalized any submissions 31 | #' 32 | #' @author Barret Schloerke 33 | #' @keywords internal 34 | send_commit_command <- function() { 35 | # require("RCurl") 36 | send_system_command(str_c("curl ", solr_base_url(), "/solr/update --data-binary '' -H 'Content-type:text/xml; charset=utf-8'")) 37 | } 38 | 39 | #' Send system command to Solr. 40 | #' Send a system command to Solr to add / update files to Solr 41 | #' 42 | #' @author Barret Schloerke 43 | #' @keywords internal 44 | send_system_command <- function(system_string) { 45 | curled_text <- system(system_string, intern = TRUE, ignore.stderr = TRUE) 46 | status <- str_sub(curled_text[3], start=47, end=47) 47 | # if (length(status) < 1 | status == NA) 48 | # status <- "FAIL" 49 | 50 | if (!identical(status, "0")) { 51 | message(str_c(curled_text, collapse = "\n")) 52 | stop("Error uploading file to solr") 53 | } 54 | 55 | "success" 56 | } -------------------------------------------------------------------------------- /R/solr-query.r: -------------------------------------------------------------------------------- 1 | #' Topic fields. 2 | #' 3 | #' @author Barret Schloerke 4 | #' @keywords internal 5 | solr_topic_fields <- function(){ 6 | c("Title_t", "Description_t", "Details_t", "Value_t", "Authors_t") 7 | } 8 | 9 | 10 | #' Topic query. 11 | #' 12 | #' @author Barret Schloerke 13 | #' @keywords internal 14 | solr_query_topic_fields <- function(query, collapse = " OR ") { 15 | str_c(solr_topic_fields(), ":", query, collapse = collapse) 16 | } 17 | 18 | 19 | #' Example query field. 20 | #' 21 | #' @author Barret Schloerke 22 | #' @keywords internal 23 | solr_example_field <- function() { 24 | "Examples_t" 25 | } 26 | 27 | 28 | #' Example query. 29 | #' 30 | #' @author Barret Schloerke 31 | #' @keywords internal 32 | solr_query_example_field <- function(query, collapse = " OR ") { 33 | str_c(solr_example_field(),":", query, collapse = collapse) 34 | } 35 | 36 | 37 | #' Combine Solr parameters. 38 | #' 39 | #' @author Barret Schloerke 40 | #' @keywords internal 41 | solr_combine_param <- function(value, param = names(value)) { 42 | str_c(param, value, sep = "=", collapse = "&") 43 | } 44 | 45 | 46 | #' Solr Topics in Example 47 | #' 48 | #' @author Barret Schloerke 49 | #' @keywords internal 50 | solr_has_topic_in_example <- function(topics) { 51 | if (! i_can_has_internetz()) return(data.frame()) 52 | 53 | query_list <- list(query = topics) 54 | 55 | result <- get_solr_query_result(query_list, TRUE) 56 | if(result$total_item_count == 0) 57 | return(data.frame()) 58 | 59 | t(sapply(result$response, function(x) { 60 | path <- package_and_topic_from_url(x$id) 61 | c(title = x$Title_t, pkg = path$pkg, topic = path$topic) 62 | })) 63 | } 64 | 65 | 66 | #' Search query path. 67 | #' return a html path for a search 68 | #' 69 | #' @param query query to be used 70 | #' @param start_pos postion to start at 71 | #' @author Barret Schloerke 72 | #' @keywords internal 73 | search_query_path <- function(query="example", start_pos=0) { 74 | str_c(base_html_path(), "/search/start=", start_pos, ";q=", query) 75 | } 76 | 77 | 78 | 79 | #' Similar pages. 80 | #' Find related pages and return info in a data.frame 81 | #' 82 | #' @param topic title to be used to find similar results 83 | #' @author Barret Schloerke 84 | #' @keywords internal 85 | solr_similar <- function(topic) { 86 | if (! i_can_has_internetz()) return(data.frame()) 87 | 88 | site <- str_c(solr_base_url(), "/solr/select?wt=json&mlt=true&mlt.count=5&mlt.fl=Title_t,Description_t&q=", solr_query_topic_fields(topic)) 89 | output <- suppressWarnings(urlJSON_to_list(site)) 90 | 91 | if (length(output$moreLIkeThis) < 1) return(data.frame()) 92 | 93 | docs <- output$moreLikeThis[[1]]$docs 94 | 95 | t(sapply(docs, function(x) { 96 | path <- package_and_topic_from_url(x$id) 97 | c(title = x$Title_t, pkg = path$pkg, topic = path$topic) 98 | })) 99 | 100 | } 101 | 102 | 103 | #' Solr query. 104 | #' Retrieve a solr query 105 | #' 106 | #' @param query_list list that contains the start position, query, and other parameters that are ready to be pasted 107 | #' @author Barret Schloerke 108 | #' @keywords internal 109 | get_solr_query_result <- function(query_list, function_field = FALSE) { 110 | 111 | if(is.null(query_list$query)) 112 | stop("query was not included in the query_list") 113 | 114 | other <- query_list$other 115 | if(is.null(other)) 116 | other <- "" 117 | else 118 | other <- str_c("&", other) 119 | 120 | start_pos <- query_list$start 121 | if(is.null(start_pos)) 122 | start_pos <- 0 123 | 124 | rows <- 20 125 | response <- urlJSON_to_list(str_c(solr_base_url(), "/solr/select/?", 126 | "version=2.2", 127 | "&wt=json", 128 | "&rows=", rows, 129 | "&start=", start_pos, 130 | "&indent=on", 131 | if (identical(function_field, FALSE)) { 132 | str_c("&hl=on", 133 | "&hl.simple.pre=", 134 | "&hl.simple.post=", 135 | "&hl.fragsize=70", 136 | "&hl.mergeContiguous=true", 137 | "&hl.fl=", str_c(solr_topic_fields(), collapse = ","), 138 | "&q=", solr_query_topic_fields(query_list$query)) 139 | } else { 140 | str_c( 141 | "&fl=", solr_example_field(), ",id,Title_t", 142 | "&q=", solr_query_example_field(query_list$query) 143 | ) 144 | } 145 | ,other 146 | )) 147 | 148 | if (identical(function_field, FALSE)) { 149 | docs <- response$highlighting 150 | } else { 151 | docs <- response$response$docs 152 | } 153 | 154 | query <- query_list$query 155 | 156 | start_pos <- as.numeric(response$responseHeader$params$start) 157 | if (is.na(start_pos) || is.null(start_pos)) { 158 | start_pos <- 0 159 | } 160 | total_item_count <- as.numeric(response$response$numFound) 161 | 162 | list( 163 | response = docs, 164 | items_before = start_pos, 165 | items_after = max(0, total_item_count - start_pos - rows), 166 | total_item_count = total_item_count, 167 | query = query 168 | ) 169 | } 170 | 171 | 172 | 173 | 174 | -------------------------------------------------------------------------------- /R/solr-save.r: -------------------------------------------------------------------------------- 1 | #' Deletes everything that belongs to a package in solr. 2 | #' 3 | #' @param package package to be deleted 4 | #' @author Barret Schloerke 5 | # ' 6 | solr_delete_package <- function(package) { 7 | if (! i_can_has_internetz()) return(NULL) 8 | 9 | site <- str_c("id:/package/",package,"/*") 10 | 11 | put_string(site) 12 | } 13 | 14 | 15 | #' Make a xml field. 16 | #' make a field for a solr document 17 | #' 18 | #' @param name name of the field 19 | #' @param value value of the field 20 | #' @author Barret Schloerke 21 | #' @keywords internal 22 | make_field <- function(name, value) { 23 | if (length(value) < 1) value <- "" 24 | value <- str_trim(value) 25 | value <- gsub("&(?![#]{1})", "&", value, perl=TRUE) 26 | value <- str_replace_all(value, "<", "<") 27 | value <- str_replace_all(value, ">", ">") 28 | value <- str_replace_all(value, "\n", "") 29 | value <- str_replace_all(value, "\t", "") 30 | if (!identical(name, "id")) name <- str_c(name, "_t") 31 | 32 | str_c("", str_c(value, collapse = "; "),"", collapse = "") 33 | } 34 | 35 | 36 | #' Turn a list into a solr doc. 37 | #' turn a list into a solr doc 38 | #' 39 | #' @param id id tag to be used 40 | #' @param obj list to perform on 41 | #' @author Barret Schloerke 42 | #' @keywords internal 43 | list_to_xml <- function(id, obj) { 44 | obj$id <- id 45 | new_obj <- list_to_double_list(obj) 46 | 47 | fields <- sapply(new_obj, function(x) { 48 | make_field(x$name, x$value) 49 | }) 50 | 51 | str_c("", str_c(fields, collapse=""), "", collapse = "") 52 | } 53 | 54 | 55 | #' Make a list into a nested list. 56 | #' this is to be done to easily use sapply and keep the name of the item 57 | #' 58 | #' @param obj list to perform on 59 | #' @author Barret Schloerke 60 | #' @keywords internal 61 | list_to_double_list <- function(obj) { 62 | new_obj <- list() 63 | for(item_name in names(obj)) { 64 | new_obj[[item_name]] <- list(name = item_name, value = obj[[item_name]]) 65 | } 66 | new_obj 67 | } 68 | 69 | 70 | #' Make it so the xml is an 'add'. 71 | #' make it so the xml is an 'add' to be commited to solr 72 | #' 73 | #' @param obj list to perform on 74 | #' @author Barret Schloerke 75 | #' @keywords internal 76 | make_add_xml <- function(obj) { 77 | str_c("", obj, "", collaspe = "") 78 | } 79 | 80 | 81 | #' Save page info. 82 | #' Save page info into xml for solr 83 | #' 84 | #' @param txt xml text string 85 | #' @param file_name location to save the file. Defaults to a temp file that is discarded when R shuts down. 86 | #' @author Barret Schloerke 87 | #' @keywords internal 88 | save_xml <- function(txt, file_name=tempfile()) { 89 | txt <- str_replace_all(txt, "", "\n\t") 90 | txt <- str_replace_all(txt, "", "\n\t") 91 | txt <- str_replace_all(txt, "\t", "") 92 | cat(txt, file = file_name) 93 | file_name 94 | } 95 | 96 | 97 | #' PUT a string to the Solr server. 98 | #' 99 | #' @author Barret Schloerke 100 | #' @keywords internal 101 | put_string <- function(string) { 102 | file_name <- save_xml(string) 103 | put_file(file_name) 104 | } 105 | 106 | #' PUT a file to the Solr server. 107 | #' 108 | #' @author Barret Schloerke 109 | #' @keywords internal 110 | put_file <- function(file_name) { 111 | # require("RCurl") 112 | cat("posting file: ", file_name,"\n") 113 | cmd <- str_c("curl ", solr_base_url(), "/solr/update --data-binary @", file_name, " -H 'Content-type:text/xml; charset=utf-8'", collapse = "") 114 | send_system_command(cmd) 115 | send_commit_command() 116 | } 117 | 118 | -------------------------------------------------------------------------------- /R/solr.r: -------------------------------------------------------------------------------- 1 | #' Solr base URL. 2 | #' 3 | #' @author Barret Schloerke 4 | #' @keywords internal 5 | solr_base_url <- function() { 6 | # "http://localhost:8983" 7 | "http://helpr32.mmx-dns.com:8080" 8 | } 9 | 10 | 11 | 12 | #' Check to see if solr is running. 13 | #' A check to see if solr is running called and memoised at the start of \code{helpr()} 14 | #' 15 | #' @param ... ignored 16 | #' @author Barret Schloerke 17 | i_can_has_internetz <- memoise(function() { 18 | if (!allow_internetz()) return(FALSE) 19 | 20 | google <- url("http://google.com") 21 | on.exit(close(google)) 22 | 23 | res <- try({suppressWarnings(open(google)); internet <- TRUE}, silent = TRUE) 24 | !inherits(res, "try-error") 25 | }) 26 | 27 | 28 | # # Produce a message that states Solr is not running. 29 | # # 30 | # # @author Barret Schloerke 31 | # # @keywords internal 32 | # solr_FAIL <- function() { 33 | # message("Full text search is not available, yet. Please wait for future versions.") 34 | # NULL 35 | # } 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | #' Pkg and topic from URL. 45 | #' Retrieve the pkg and topic from the URL 46 | #' 47 | #' @param url_txt url to be parsed 48 | #' @author Barret Schloerke 49 | #' @keywords internal 50 | package_and_topic_from_url <- function(url_txt) { 51 | pkg <- "" 52 | topic <- "" 53 | if (str_detect(url_txt, "/package/")) { 54 | pkg <- str_extract(url_txt, "/package/[a-zA-Z_.0-9]*/") 55 | pkg <- str_replace_all(pkg, "/package/", "") 56 | pkg <- str_replace_all(pkg, "/", "") 57 | 58 | if (str_detect(url_txt, "/topic/")) { 59 | topic <- str_split(url_txt, "/topic/")[[1]][2] 60 | } 61 | } 62 | 63 | list(pkg = pkg, topic = topic) 64 | } 65 | 66 | 67 | 68 | 69 | #' Helpr Search. 70 | #' 71 | #' @param query_list list that contains the start position, query, and other parameters 72 | #' @return returns all the necessary information from a search 73 | #' @author Barret Schloerke 74 | #' @keywords internal 75 | helpr_solr_search <- function(query_list) { 76 | if (! i_can_has_internetz()) return(NULL) 77 | 78 | result <- get_solr_query_result(query_list) 79 | items <- result$response 80 | 81 | urls <- as.character(names(items)) 82 | 83 | list( 84 | urls = urls, 85 | items = items, 86 | items_before = result$items_before, 87 | items_after = result$items_after, 88 | query = result$query, 89 | start_pos = result$items_before, 90 | row_count = 20, 91 | total_item_count = result$total_item_count 92 | ) 93 | 94 | 95 | } 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # helpr 2 | 3 | Helpr is an R package that betters friendly HTML documentation. With links to other packages, function aliases, and function sources, finding information is a click away. Using the comprehensive search bar, searching across all R packages is quick and effortless. 4 | 5 | The heart of `helpr` is hosted locally. No internet is required to display all of the documentation, while functionality of the search bar, RSS feed, and comment system requires an internet connection. 6 | 7 | The development of `helpr` was made possible with generous support from Revolution Analytics. 8 | 9 | # Main Features 10 | 11 | * Home Screen 12 | * List of all packages loaded / installed 13 | * Links to all R Manuals 14 | * Allows you to update out-of-date packages 15 | 16 | * Package Page 17 | * Every help page link is split into groups 18 | * Links to package vignettes and demos 19 | * List of general information: Authors, Suggests, Depends, Reverse 20 | Dependencies, and CRAN info 21 | * Change log of the latest version 22 | * Disqus comment system 23 | 24 | * Topic Page 25 | * Display of Description, Usage, Arguments, Details, Value, and Source 26 | * Usage links to source of each main function 27 | * List of Authors and “See Also” 28 | * Examples with full syntax highlighting and able to embed non-interactive 29 | example output in browser 30 | * List of top functions used in the examples 31 | * Disqus comment system 32 | 33 | * Source Page 34 | * Function description 35 | * Full syntax highlighting 36 | * List of top functions used in the source 37 | * Disqus comment system 38 | 39 | * Demo Page 40 | * Demo description 41 | * Links to other demos within the same package 42 | * List of top functions used in the demo 43 | * Full syntax highlighting and able to embed non-interactive demo 44 | output in browser 45 | 46 | # Installation 47 | 48 | To install `helpr`, you first need to install some packages: 49 | 50 | * from CRAN: `install.packages( c("stringr", "digest", "mutatr", "brew", "testthat") )` 51 | * from github: `http://github.com/hadley/sinartra` 52 | 53 | # Running helpr 54 | 55 | Running from an installed package: 56 | 57 | library(helpr) 58 | helpr() 59 | 60 | Running the development version: 61 | 62 | # With working directory set to the helpr package directory 63 | library(devtools) 64 | load_all("helpr") 65 | helpr() 66 | 67 | 68 | 69 | # FOR SERVER DEVELOPERS ONLY!!! 70 | 71 | Follow the [tutorial](http://lucene.apache.org/solr/tutorial.html) to get a feel how it works. 72 | 73 | (Developers) To install `solr`, you first need to install `brew` 74 | 75 | * install brew: `ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)"` 76 | * install solr with brew: `brew install solr` 77 | 78 | * Add/replace the two files in solr-conf to solr's example/solr/conf folder 79 | * Execute the command `java -jar start.jar` in the /example solr directory to start the server 80 | * my solr is installed at `/usr/local/Cellar/solr/1.4.0/` 81 | * To add/update files, execute one of the index commands from R 82 | 83 | `index_topic(package, topic)` 84 | `index_package(package)` 85 | `index_all()` 86 | 87 | # Design inspiration 88 | 89 | * http://www.smashingmagazine.com/2009/06/09/smart-fixes-for-fluid-layouts/ 90 | * http://www.sohtanaka.com/web-design/smart-columns-w-css-jquery/ 91 | * http://desandro.com/demo/masonry/ 92 | * http://cssiphone.com/gallery/ 93 | * http://mediaqueri.es/popular/ 94 | * https://github.com/davatron5000/FitText.js 95 | * http://trentwalton.com/ 96 | 97 | 98 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | √ Make RCurl a suggestion 2 | √ Server functions (solr POSTing code) should require("RCurl") 3 | 4 | √ Local mode (!i_can_has_internetz): should not use RCurl, activates when asked for by the user. 5 | 6 | 7 | √ Make a "custom" mode that can be started when helpr needs to be done through the custom handler 8 | 9 | This needs changes to sinartra to make this easy to implement. A router 10 | should have a base URL, which is automatically stripped from the incoming 11 | url, and is automatically added to outgoing URLs for redirect. 12 | 13 | 14 | √ Move depends to imports (everything apart from rjson), so they don't clutter 15 | the user's workspace. 16 | 17 | √To do this, you need to move them from Depends to Imports in the 18 | DESCRIPTION, and add @import highlight, sinartra, ... in the package 19 | documentation rdoc. No function call should have :: in front of it. 20 | 21 | * Create helprServr and move all server related code out of helpr and into 22 | helprServr 23 | 24 | * Replace all uses of system curl with RCurl. 25 | 26 | 27 | indexing packages... 28 | These don't work 29 | BoolNet, cwhmisc, epitools, multxpert, networksis, openair, pequod, pgirmess, qtl, simone, TeachingSampling 30 | 31 | 32 | 33 | Solr 34 | √index all internal functions of each function 35 | √add list to source page 36 | √similar solr? 37 | √find documents similar to the one looking at 38 | √return answers 39 | √more truncation 40 | √ (smaller results) set to 70 chars 41 | √just give answer, not from where (no title necessary) 42 | √highlight results on next page (javascript to inspect for referrer, extract q param and then match) 43 | √Change Solr params into ?a=5&b=6 44 | 45 | 46 | 47 | New 48 | √ loading a package while you wait needs a screen to tell you that 49 | √ change log stuff 50 | √ allow install of single package 51 | √ make the search bar disappear if solr is not available 52 | √ add to topic page what similar functions exist in sidebar 53 | Solr 54 | 55 | Fix Pages 56 | FAIL - find out how to find out if a topic is a function or not without loading the package 57 | REWORK - reorganized the package page to make it independent. Also used keywords for grouping. 58 | √ - add in the footer, description, and readme that this is "funded by Revolution Analytics" 59 | 60 | Writing 61 | REVIEW - two paragraph description of "why this is helpful" and "why you should use it" 62 | 63 | 64 | 65 | ? fix topic space for internal function stuff 66 | -------------------------------------------------------------------------------- /ideas.md: -------------------------------------------------------------------------------- 1 | Individual pages 2 | ================ 3 | 4 | ## Main 5 | 6 | * WAIT - Main page - display latest changes from CHANGELOG 7 | * a function page should show all change logs related to that function 8 | * Needs Change Log 9 | * √ Pull in RSS feeds? 10 | * √ needs to be slower 11 | * √ Only display loaded packages 12 | * √ Display out of date packages 13 | * √ button invoked and highlight 14 | * √ needs spinning wheel of death (iphone style) 15 | * √ - needs install individual button 16 | * √ Button to show all packages 17 | * √ needs to 'talk' with old packages button 18 | * √ Rewrite alternative to installed.packages() that is much faster 19 | * √ Top ten functions and most recently used 10 functions 20 | * √ add links to the manuals 21 | * √ Had coded: should be memoised or hard coded? 22 | 23 | ## Package 24 | 25 | * √ link to CRAN page 26 | * PARTIAL - links to news & changelogs 27 | * needs to have a render brew template 28 | * √ Link to demos 29 | * √ vignettes 30 | * √ separate data and functions 31 | * VALIDATION - needs to be able to find functions that are in a namespace, such as the package tools 32 | * √ show internal functions separately 33 | * WAIT - integrate with crantastics 34 | * √ ratings 35 | * reviews 36 | * √ show package dependencies 37 | * √ show package suggests 38 | * √ show package imports 39 | * √ show package extends 40 | * √ reverse dependencies 41 | 42 | * see CRAN page for more ideas 43 | 44 | ## Demo 45 | 46 | * √ Send to a new page 47 | * See Code Execution 48 | * √ blocks screen 49 | * √ performs in Terminal 50 | * √ Have interaction with demo things 51 | * √ Execute whole demo 52 | * √ Execute highlighted part 53 | * √ Have output done within the example 54 | * √ an update from evaluate 55 | * √ Use parser to count all the functions used by the demo. For functions that are called most offline, add cross-links to the demo from their topic page 56 | 57 | ## Topic 58 | 59 | * DONE? - "did you mean?" - include list of all topics with the same name in different packages 60 | * handled when "?mutli_pkg_topic" is executed 61 | * DEB - use latent dirichlet topic models to provide see also links based on description and details. 62 | * DEB - display hyperlinked keywords 63 | * √ view source - shows function source 64 | * WAIT - rate a function 65 | * Crantastic 66 | * √ add comments - look at something like disqus 67 | * √ add to every page 68 | * √ demo 69 | * NO - index.html 70 | * √ package 71 | * √ source 72 | * √ topic 73 | * √ links for "mailto" 74 | * DEB - display keywords 75 | * √ list of all fuctions that are under the topic 76 | * √ links to the source code of said function 77 | * BUSY - Execute example functionality 78 | * click button to execute example 79 | * √ See Code Execution 80 | 81 | 82 | Code Execution 83 | ================== 84 | 85 | * √ Parse examples and add links to functions that are used 86 | * √ Send selected/highlighted expression to R console 87 | * √ silently remove "bad" text 88 | * NEED - to remove the notification 89 | * √ Evaluate all example code and interleave results back in html 90 | * √ using evaluate package 91 | * √ Add jQuery to notify user 92 | * √ "Easy"(run) button 93 | * √ all executed code should appear in the console 94 | * √ Rewrite the "replay" method for eval with details to produce html output. 95 | * √ baller status achieved - be cool, make it S3 96 | 97 | 98 | Dynamic help 99 | ============ 100 | 101 | Function weights 102 | * ??? - overall CRAN 103 | * √ personal function use: parse .Rhistory and pull out functions 104 | 105 | Function mispelling 106 | 107 | 108 | Search 109 | ====== 110 | 111 | * √ external solr search engine with separate fields for separate parts of RDoc. 112 | * NEEDS - external server 113 | * for use by 114 | * insider 115 | * √ html search 116 | * WAIT - indexes all packages - not just those installed on the users machine. 117 | * NEEDS - external server 118 | * lists of functions indexed by keyword 119 | 120 | 121 | Speed 122 | ===== 123 | 124 | * Build index of packages as needed, but cache between executions. 125 | Use package dates to intelligently invalidate the cache after updates. 126 | 127 | 128 | Style 129 | ===== 130 | 131 | Few images, so need creative use of typography. 132 | 133 | * Loupe to display function usage 134 | * Use jsmath (http://www.math.union.edu/~dpvc/jsMath/) for nice math display 135 | * Draw inspiration from hannah rd (http://github.com/mislav/hanna), see example at http://gitrdoc.com/mislav/will_paginate/tree/master 136 | 137 | * http://24ways.org/2006/compose-to-a-vertical-rhythm 138 | * implement more even line breaks (using Knuth algorithm) for headers with jquery? 139 | * http://www.smashingmagazine.com/2009/01/27/css-typographic-tools-and-techniques/ 140 | * http://css-tricks.com/typographic-grid/ 141 | * http://rikrikrik.com/jquery/quicksearch/ -------------------------------------------------------------------------------- /inst/public/.gitignore: -------------------------------------------------------------------------------- 1 | _tmp_pictures -------------------------------------------------------------------------------- /inst/public/_images/Metamarkets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hadley/helpr/2eeb174b09493f8d5c4c072772285c100f410a29/inst/public/_images/Metamarkets.png -------------------------------------------------------------------------------- /inst/public/_images/Revolution_Analytics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hadley/helpr/2eeb174b09493f8d5c4c072772285c100f410a29/inst/public/_images/Revolution_Analytics.png -------------------------------------------------------------------------------- /inst/public/_images/busy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hadley/helpr/2eeb174b09493f8d5c4c072772285c100f410a29/inst/public/_images/busy.gif -------------------------------------------------------------------------------- /inst/public/_images/delete.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hadley/helpr/2eeb174b09493f8d5c4c072772285c100f410a29/inst/public/_images/delete.gif -------------------------------------------------------------------------------- /inst/public/_images/mozilla_blu.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hadley/helpr/2eeb174b09493f8d5c4c072772285c100f410a29/inst/public/_images/mozilla_blu.gif -------------------------------------------------------------------------------- /inst/public/_images/ui-icons_000000_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hadley/helpr/2eeb174b09493f8d5c4c072772285c100f410a29/inst/public/_images/ui-icons_000000_256x240.png -------------------------------------------------------------------------------- /inst/public/_images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hadley/helpr/2eeb174b09493f8d5c4c072772285c100f410a29/inst/public/_images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /inst/public/_images/ui-icons_444444_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hadley/helpr/2eeb174b09493f8d5c4c072772285c100f410a29/inst/public/_images/ui-icons_444444_256x240.png -------------------------------------------------------------------------------- /inst/public/_images/ui-icons_cccccc_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hadley/helpr/2eeb174b09493f8d5c4c072772285c100f410a29/inst/public/_images/ui-icons_cccccc_256x240.png -------------------------------------------------------------------------------- /inst/public/_images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hadley/helpr/2eeb174b09493f8d5c4c072772285c100f410a29/inst/public/_images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /inst/public/_scripts/jquery.highlight-3.yui.js: -------------------------------------------------------------------------------- 1 | jQuery.fn.highlight=function(b){function a(e,j){var l=0;if(e.nodeType==3){var k=e.data.toUpperCase().indexOf(j);if(k>=0){var h=document.createElement("span");h.className="highlight";var f=e.splitText(k);var c=f.splitText(j.length);var d=f.cloneNode(true);h.appendChild(d);f.parentNode.replaceChild(h,f);l=1}}else{if(e.nodeType==1&&e.childNodes&&!/(script|style)/i.test(e.tagName)){for(var g=0;g"+q.title+"";if(g.date_format&&g.date_format.length>0){list_item+=""+k(q.publishedDate,g.date_format)+""}switch(g.show_descriptions){case"image":list_item+=""+h(q.content)+""+q.contentSnippet+"";break;case"content":list_item+=""+q.content+"";break;case true:case"true":list_item+=""+q.contentSnippet+"";break;default:break}o+="
  • "+list_item+"
  • "});$(i).append(o)}function k(o,r){var n=["January","February","March","April","May","June","July","August","September","October","November","December"],s=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=new Date(Date.parse(o)),q="";for(var p=0;p12)?o.getHours()-12:o.getHours();break;case"G":q+=o.getHours();break;case"h":q+=e((o.getHours()>12)?o.getHours()-12:o.getHours());break;case"H":q+=e(o.getHours());break;case"i":q+=e(o.getSeconds());break;case"s":q+=e(o.getDate());break;case"u":q+=o.getMilliseconds();break;case"e":break;case"O":case"P":q+=o.getTimezoneOffset();break;case"T":break;case"Z":break;case"c":q+=o.toUTCString();break;case"r":q+=o.toDateString();break;case"U":q+=o.valueOf();break;default:q+=r.charAt(p);break}}return q}function j(o){var n=parseInt(o.toString().substring(o.toString().length-1));switch(n){case 1:return"st";break;case 2:return"nd";break;case 3:return"rd";break;default:return"th";break}}function e(n){var o=n.toString();if(o.length<2){o="0"+o}return o}function h(o){var n=o.match(/+]*>/i);if(n){var p=n[0].match(/src="[^"+]*"/i),q=n[0].match(/alt="[^"+]*"/i);return""}return""}a.getScript("https://www.google.com/jsapi",function(){google.load("feeds","1",{callback:f})})}})(jQuery,this); -------------------------------------------------------------------------------- /inst/public/_scripts/jquery.quicksearch.js: -------------------------------------------------------------------------------- 1 | jQuery(function ($) { 2 | $.fn.quicksearch = function (opt) { 3 | 4 | function is_empty(i) 5 | { 6 | return (i === null || i === undefined || i === false) ? true: false; 7 | } 8 | 9 | function strip_html(input) 10 | { 11 | var regexp = new RegExp(/\<[^\<]+\>/g); 12 | var output = input.replace(regexp, ""); 13 | output = $.trim(output.toLowerCase().replace(/\n/, '').replace(/\s{2,}/, ' ')); 14 | return output; 15 | } 16 | 17 | function get_key() 18 | { 19 | var input = strip_html($('input[rel="' + options.randomElement + '"]').val()); 20 | 21 | if (input.indexOf(' ') === -1) 22 | { 23 | return input; 24 | } 25 | else 26 | { 27 | return input.split(" "); 28 | } 29 | } 30 | 31 | function test_key(k, value, type) 32 | { 33 | if (type === "string") 34 | { 35 | return test_key_string(k, value); 36 | } 37 | else 38 | { 39 | return test_key_arr(k, value); 40 | } 41 | } 42 | 43 | function test_key_string(k, value) 44 | { 45 | return (value.indexOf(k) > -1); 46 | } 47 | 48 | function test_key_arr(k, value) 49 | { 50 | for (var i = 0; i < k.length; i++) { 51 | var test = value.indexOf(k[i]); 52 | if (test === -1) { 53 | return false; 54 | } 55 | } 56 | return true; 57 | } 58 | 59 | function select_element(el) 60 | { 61 | if (options.hideElement === "grandparent") 62 | { 63 | return $(el).parent().parent(); 64 | } 65 | else if (options.hideElement === "parent") 66 | { 67 | return $(el).parent(); 68 | } 69 | else 70 | { 71 | return $(el); 72 | } 73 | } 74 | 75 | function stripe(el) 76 | { 77 | if (doStripe) 78 | { 79 | var i = 0; 80 | select_element(el).filter(':visible').each(function () { 81 | 82 | for (var j = 0; j < stripeRowLength; j++) 83 | { 84 | if (i === j) 85 | { 86 | $(this).addClass(options.stripeRowClass[i]); 87 | 88 | } 89 | else 90 | { 91 | $(this).removeClass(options.stripeRowClass[j]); 92 | } 93 | } 94 | i = (i + 1) % stripeRowLength; 95 | }); 96 | } 97 | } 98 | 99 | function fix_widths(el) 100 | { 101 | $(el).find('td').each(function () { 102 | $(this).attr('width', parseInt($(this).css('width'))); 103 | }); 104 | } 105 | 106 | function loader(o) { 107 | if (options.loaderId) 108 | { 109 | var l = $('input[rel="' + options.randomElement + '"]').parent().find('.loader'); 110 | if (o === 'hide') 111 | { 112 | l.hide(); 113 | } 114 | else 115 | { 116 | l.show(); 117 | } 118 | } 119 | } 120 | 121 | function place_form() { 122 | var formPosition = options.position; 123 | var formAttached = options.attached; 124 | 125 | if (formPosition === 'before') { 126 | $(formAttached).before(make_form()); 127 | } else if (formPosition === 'prepend') { 128 | $(formAttached).prepend(make_form()); 129 | } else if (formPosition === 'append') { 130 | $(formAttached).append(make_form()); 131 | } else { 132 | $(formAttached).after(make_form()); 133 | } 134 | } 135 | 136 | function make_form_label() 137 | { 138 | if (!is_empty(options.labelText)) { 139 | return ' '; 143 | } 144 | return ''; 145 | } 146 | 147 | function make_form_input() 148 | { 149 | var val = (!is_empty(options.inputText)) ? options.inputText : "" 150 | return ' '; 151 | } 152 | 153 | function make_form_loader() 154 | { 155 | if (!is_empty(options.loaderImg)) { 156 | return 'Loading'; 157 | } else { 158 | return '' + options.loaderText + ''; 159 | } 160 | } 161 | 162 | function make_form() 163 | { 164 | var f = (!options.isFieldset) ? 'form' : 'fieldset'; 165 | return '<' + f + ' action="#" ' + 'id="'+ options.formId + '" ' + 'class="quicksearch">' + 166 | make_form_label() + make_form_input() + make_form_loader() + 167 | ''; 168 | } 169 | 170 | function focus_on_load() 171 | { 172 | $('input[rel="' + options.randomElement + '"]').get(0).focus(); 173 | } 174 | 175 | function toggle_text() { 176 | $('input[rel="' + options.randomElement + '"]').focus(function () { 177 | if ($(this).val() === options.inputText) { 178 | $(this).val(''); 179 | } 180 | }); 181 | $('input[rel="' + options.randomElement + '"]').blur(function () { 182 | if ($(this).val() === "") { 183 | $(this).val(options.inputText); 184 | } 185 | }); 186 | } 187 | 188 | function get_cache(el) 189 | { 190 | return $(el).map(function(){ 191 | return strip_html(this.innerHTML); 192 | }); 193 | } 194 | 195 | function init() 196 | { 197 | place_form(); 198 | if (options.fixWidths) fix_widths(el); 199 | if (options.focusOnLoad) focus_on_load(); 200 | if (options.inputText != "" && options.inputText != null) toggle_text(); 201 | 202 | cache = get_cache(el); 203 | 204 | stripe(el); 205 | loader('hide'); 206 | } 207 | 208 | function qs() 209 | { 210 | clearTimeout(timeout); 211 | timeout = setTimeout(function () { 212 | 213 | loader('show'); 214 | 215 | setTimeout(function () { 216 | options.onBefore(); 217 | 218 | var k = get_key(); 219 | var k_type = (typeof k); 220 | var i = 0; 221 | 222 | k = options.filter(k); 223 | 224 | if (k != "") 225 | { 226 | if (typeof score[k] === "undefined") 227 | { 228 | score[k] = new Array(); 229 | cache.each(function (i) { 230 | if (test_key(k, cache[i], k_type)) 231 | { 232 | score[k][i] = true; 233 | } 234 | }); 235 | } 236 | 237 | if (score[k].length === 0) 238 | { 239 | select_element(el).hide(); 240 | } 241 | else 242 | { 243 | $(el).each(function (i) { 244 | if (score[k][i]) 245 | { 246 | select_element(this).show(); 247 | } 248 | else 249 | { 250 | select_element(this).hide(); 251 | } 252 | }); 253 | 254 | } 255 | } 256 | else 257 | { 258 | select_element(el).show(); 259 | } 260 | 261 | stripe(el); 262 | }, options.delay/2); 263 | 264 | setTimeout( function () { 265 | loader('hide'); 266 | }, options.delay/2); 267 | 268 | options.onAfter(); 269 | 270 | }, options.delay/2); 271 | } 272 | 273 | var options = $.extend({ 274 | position: 'prepend', 275 | attached: 'body', 276 | formId: 'quicksearch', 277 | labelText: 'Quick Search', 278 | labelClass: 'qs_label', 279 | inputText: null, 280 | inputClass: 'qs_input', 281 | loaderId: 'loader', 282 | loaderClass: 'loader', 283 | loaderImg: null, 284 | loaderText: 'Loading...', 285 | stripeRowClass: null, 286 | hideElement: null, 287 | delay: 500, 288 | focusOnLoad: false, 289 | onBefore: function () { }, 290 | onAfter: function () { }, 291 | filter: function (i) { 292 | return i; 293 | }, 294 | randomElement: 'qs' + Math.floor(Math.random() * 1000000), 295 | isFieldset: false, 296 | fixWidths: false 297 | }, opt); 298 | 299 | var timeout; 300 | var score = {}; 301 | var stripeRowLength = (!is_empty(options.stripeRowClass)) ? options.stripeRowClass.length : 0; 302 | var doStripe = (stripeRowLength > 0) ? true : false; 303 | var el = this; 304 | var cache; 305 | var selector = $(this).selector; 306 | 307 | $.fn.extend({ 308 | reset_cache: function () { 309 | el = $(selector); 310 | cache = get_cache(el); 311 | } 312 | }); 313 | 314 | init(); 315 | 316 | $('input[rel="' + options.randomElement + '"]').keyup(function (e) { 317 | var keycode = e.keyCode; 318 | if ($("#quicksearch input.qs_input").val() == "") { 319 | clearTimeout(timeout); 320 | $("#packages tbody tr").css("display", null); 321 | } else { 322 | if (!(keycode === 9 || keycode === 13 || keycode === 16 || keycode === 17 || keycode === 18 || keycode === 38 || keycode === 40 || keycode === 224)) 323 | { 324 | qs(); 325 | } 326 | } 327 | }); 328 | 329 | $('form.quicksearch, fieldset.quicksearch').submit( function () { return false; }); 330 | 331 | return this; 332 | }; 333 | }); 334 | 335 | 336 | $(function(){ 337 | if(document.getElementById("packages")) { 338 | $('#packages tbody tr').quicksearch({ 339 | position: 'before', 340 | attached: '#packages', 341 | labelText: 'Filter: ', 342 | fixWidths: true 343 | }); 344 | } 345 | 346 | if(document.getElementById("files")) { 347 | $('#files tbody tr').quicksearch({ 348 | position: 'before', 349 | attached: '#files', 350 | labelText: 'Filter: ', 351 | selector: 'th', 352 | fixWidths: true 353 | }); 354 | } 355 | }) 356 | -------------------------------------------------------------------------------- /inst/public/_scripts/notification.js: -------------------------------------------------------------------------------- 1 | function set_on_click(section){ 2 | 3 | $("#bd").mouseup(function(e){ 4 | 5 | var offset = $(section).offset(); 6 | o.log(e.pageX +', '+ e.pageY + "\tdiv position: " + offset.left + ", " + offset.top); 7 | 8 | var code = $.trim(get_output_selected_text(section)); 9 | if (! code ) { 10 | $("#run_highlight").hide(); 11 | return; 12 | } 13 | 14 | // $("#run_highlight").offset({ top: e.pageY, left: (offset.left - $("#run_highlight").width() - 20) }); 15 | $("#run_highlight").show('slow'); 16 | }); 17 | } 18 | 19 | 20 | 21 | function r_urlencode (str) { 22 | str = escape(str); 23 | return str.replace(/[*+\/@]|%20/g, 24 | function (s) { 25 | switch (s) { 26 | case "*": s = "%2A"; break; 27 | case "+": s = "%2B"; break; 28 | case "/": s = "%2F"; break; 29 | case "@": s = "%40"; break; 30 | } 31 | return s; 32 | } 33 | ); 34 | } 35 | 36 | 37 | 38 | // hide/show the R output 39 | var has_shown_output = 0; 40 | var output_hidden = 1; 41 | function hide_show_output(demo_topic, package, text_name){ 42 | $("#run_highlight").hide(); 43 | 44 | if(output_hidden == 0){ 45 | o.log("Hide output!"); 46 | $(".R_output").hide(); 47 | $(".R_output_image").hide(); 48 | // $(".R_output").hide('slow'); 49 | }else{ 50 | o.log("Show output!"); 51 | 52 | if(has_shown_output == 0){ 53 | evaluate_section(demo_topic, package, text_name) 54 | has_shown_output = 1; 55 | }else{ 56 | $(".R_output").show('slow'); 57 | $(".R_output_image").show('slow'); 58 | } 59 | } 60 | output_hidden = (output_hidden+1) % 2; 61 | } 62 | 63 | 64 | // Notification: 65 | // http://awgy.net/achtung/demo/ 66 | 67 | // Block Screen: 68 | // http://jquery.malsup.com/block/#page 69 | 70 | // Produces black with checkmark 71 | var notice_settings = { 72 | timeout: 3, 73 | className: 'achtungSuccess', 74 | icon: 'ui-icon-check' 75 | } 76 | 77 | // Wrapper to notify user with text 78 | function notify(text){ 79 | $.achtung(notice_settings, { 80 | message: text 81 | }); 82 | } 83 | 84 | // Produces red with error symbol 85 | var error_settings = { 86 | timeout: 3, 87 | className: 'achtungFail', 88 | icon: 'ui-icon-alert' 89 | } 90 | 91 | // Wrapper to notify user of error 92 | function error_notify(text){ 93 | $.achtung(error_settings, { 94 | message: text 95 | }); 96 | } 97 | 98 | function message_notify(text){ 99 | $.achtung({timeout: 3, icon: 'ui-icon-alert'}, { 100 | message: text 101 | }); 102 | } 103 | 104 | 105 | 106 | 107 | // Retrive the selected text on the page 108 | // http://www.codetoad.com/javascript_get_selected_text.asp 109 | function getSelText() 110 | { 111 | if (window.getSelection){ 112 | return window.getSelection(); 113 | } else if (document.getSelection) { 114 | return document.getSelection(); 115 | }else if (document.selection){ 116 | return document.selection.createRange().text; 117 | }else 118 | return; 119 | } 120 | 121 | 122 | 123 | function get_output_selected_text(section){ 124 | var code = getSelText() + ""; 125 | o.log("Selected Code: \n" + code); 126 | if(code == "") 127 | return ""; 128 | 129 | o.log("Section: "+section+"\ncode_index: "+$(section).text().indexOf(code)); 130 | var i; 131 | code = "" + code; 132 | var lines = code.split("\n"); 133 | for(i =0; i < lines.length; i++){ 134 | o.log("Section: "+lines[i]+"\ncode_index: "+$(section).text().indexOf(lines[i])+"\noutput_index: "+$(".R_output").text().indexOf(lines[i])); 135 | if( $(section).text().indexOf(lines[i]) < 0) { 136 | // message_notify("Removing: \n"+lines[i]); 137 | lines[i] = ""; 138 | } else if( $(".R_output").text().indexOf(lines[i]) >= 0) { 139 | // message_notify("Removing: \n"+lines[i]); 140 | lines[i] = ""; 141 | } 142 | } 143 | 144 | code = lines.join("%0A"); 145 | code = r_urlencode(code); 146 | o.log("code : " + code); 147 | 148 | return code; 149 | 150 | } 151 | 152 | // Block the screen while code is executed 153 | function run_selected_code(section){ 154 | 155 | var code = get_output_selected_text(section); 156 | 157 | if(code == "") 158 | return; 159 | 160 | $.blockUI({ message: '

    Running selected code in the R console

    ' }); 161 | 162 | setTimeout(function(){ 163 | jQuery.ajax({ 164 | url: routerUrl + "/eval_text/" + code, 165 | dataType: "json", 166 | success: function() { 167 | $.unblockUI(); 168 | notify("The highlighted selection has finished executing in the R console."); 169 | }, 170 | error:function (xhr, ajaxOptions, thrownError){ 171 | $.unblockUI(); 172 | error_notify("The code that was selected did not run execute properly."); 173 | } 174 | }) 175 | }, 500); 176 | } 177 | 178 | 179 | 180 | function evaluate_section(demo_topic, package, demo_name){ 181 | 182 | $.blockUI({ message: "

    Running "+demo_topic+". Please wait.

    " }); 183 | 184 | setTimeout(function(){ 185 | jQuery.ajax({ 186 | url: routerUrl + "/eval_"+demo_topic+"/" + package + "~" + demo_name, 187 | dataType: "html", 188 | success: function(eval_code) { 189 | $("#"+demo_topic+"_source_code").html(eval_code) 190 | $.unblockUI(); 191 | 192 | }, 193 | error:function (xhr, ajaxOptions, thrownError){ 194 | $.unblockUI(); 195 | error_notify("The "+demo_topic+" did not execute properly."); 196 | } 197 | }) 198 | }, 500); 199 | 200 | } 201 | 202 | -------------------------------------------------------------------------------- /inst/public/_scripts/old_packs.js: -------------------------------------------------------------------------------- 1 | var showing_all = 0; 2 | function show_all_packages() { 3 | $("#packages").toggleClass("loaded"); 4 | 5 | showing_all = (showing_all + 1) %2; 6 | if(showing_all == 0){ 7 | $("#show_all_packs_button").attr("value", "Show All Packages"); 8 | }else{ 9 | $("#show_all_packs_button").attr("value", "Show Loaded Packages"); 10 | } 11 | 12 | set_update_button(); 13 | } 14 | 15 | // highlight all old, out-of-date packages 16 | var has_highlighted = 0; 17 | function highlight_old_packages() { 18 | has_highlighted = 1; 19 | 20 | $.blockUI({ message: "

    Finding Old Packages

    " }); 21 | 22 | jQuery.ajax({ 23 | url: routerUrl + "/package/old.json", 24 | dataType: "json", 25 | success: function(packages) { 26 | if(packages == null){ 27 | set_update_button(); 28 | $.unblockUI(); 29 | return; 30 | } 31 | o.log(packages); 32 | // o.log(packages.length); 33 | for(i = 0; i < packages.length; i++) { 34 | pkg = packages[i]; 35 | pkg = pkg.replace(".", "_"); 36 | o.log(pkg + " is old"); 37 | $("#" + pkg).addClass("old"); 38 | } 39 | 40 | $("tr.old").hover( 41 | function () { 42 | var pkg = $(this).find("td:first").text(); 43 | o.log(pkg); 44 | $(this).find("td:last").prepend($(" ")); 45 | }, 46 | function () { 47 | $(this).find("input:last").remove(); 48 | } 49 | ); 50 | 51 | 52 | set_update_button(); 53 | $.unblockUI(); 54 | } 55 | }) 56 | 57 | } 58 | 59 | // update all out-of-date packages 60 | function update_packs() { 61 | var out_of_date_butto = $("#out_of_date_button"); 62 | out_of_date_butto.value = "Updating..."; 63 | out_of_date_butto.disabled = true; 64 | 65 | var all = "FALSE"; 66 | if(showing_all == 1) 67 | all = "TRUE"; 68 | 69 | $.blockUI({ message: "

    Updating Packages

    " }); 70 | 71 | jQuery.ajax({ 72 | url: routerUrl + "/package/update.json/"+all, 73 | dataType: "json", 74 | success: function(packages) { 75 | o.log(packages); 76 | for(i = 0; i < packages.length; i++) { 77 | pkg = packages[i]; 78 | pkg = pkg.replace(".", "_"); 79 | $("#" + pkg).removeClass("old").addClass("update"); 80 | } 81 | remove_single_install_button(); 82 | set_update_button(); 83 | 84 | $.unblockUI(); 85 | 86 | if(packages.length == 1) 87 | notify(packages[0] + " has been updated"); 88 | else if(packages.length > 1) 89 | notify(packages.length + " packages have been updated"); 90 | 91 | } 92 | }) 93 | } 94 | 95 | function pluralize(count, word) 96 | { 97 | if(count > 1) 98 | return word + "s"; 99 | else 100 | return word; 101 | } 102 | 103 | function set_update_button(){ 104 | 105 | // if highlight_old_packages has not been run, return 106 | if(has_highlighted == 0) 107 | return; 108 | 109 | var i; 110 | var count = 0; 111 | 112 | // count all visible rows that are out_of_date 113 | var packs = document.getElementById("packages").tBodies[0]; 114 | 115 | // count all visible packages that are 'old' 116 | for(i = 0; i < packs.childNodes.length; i++){ 117 | var pkg = packs.childNodes[i]; 118 | 119 | if(pkg.nodeType==1 && $(pkg).hasClass("old") && ($(pkg).hasClass("loaded") || showing_all == 1)){ 120 | // o.log( pkg.childNodes[1].childNodes[0].innerHTML + ": " + $(pkg).hasClass("old") + " : "+ !$(pkg).hasClass("hide")); 121 | count++; 122 | } 123 | } 124 | 125 | // set state of update button 126 | var out_of_date_butto = document.getElementById("out_of_date_button"); 127 | if(count > 0){ 128 | out_of_date_butto.value = "Update " + count + " "+pluralize(count, "Package"); 129 | out_of_date_butto.onclick = update_packs; 130 | out_of_date_butto.disabled = false; 131 | } 132 | else{ 133 | out_of_date_butto.value = "All up to date"; 134 | out_of_date_butto.onclick = ""; 135 | out_of_date_butto.disabled = true; 136 | } 137 | 138 | } 139 | 140 | function remove_single_install_button() { 141 | $("tr.update").unbind('mouseenter mouseleave'); 142 | } 143 | 144 | 145 | function install_package(pkg){ 146 | 147 | $.blockUI({ message: "

    Installing "+pkg+". Please wait.

    " }); 148 | 149 | setTimeout(function(){ 150 | jQuery.ajax({ 151 | url: routerUrl + "/package/install.json/" + pkg, 152 | dataType: "json", 153 | success: function(txt) { 154 | $("#" + pkg).removeClass("old").addClass("update"); 155 | $("#" + pkg).find("input:last").remove(); 156 | remove_single_install_button(); 157 | 158 | set_update_button(); 159 | $.unblockUI(); 160 | notify(pkg + " has been updated"); 161 | }, 162 | error:function (xhr, ajaxOptions, thrownError){ 163 | $.unblockUI(); 164 | error_notify(pkg + " could not be installed properly."); 165 | } 166 | }) 167 | }, 500); 168 | 169 | } 170 | 171 | 172 | -------------------------------------------------------------------------------- /inst/public/_scripts/out.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var Out; 3 | var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; 4 | Out = (function() { 5 | var hasConsoleError, hasConsoleLog; 6 | function Out() { 7 | this.ut = __bind(this.ut, this); 8 | this.log = __bind(this.log, this); 9 | this.ut_error = __bind(this.ut_error, this); this.test = false; 10 | this.verbose = true || this.test; 11 | } 12 | hasConsoleLog = (typeof console !== "undefined" && console !== null ? console.log : void 0) != null; 13 | hasConsoleError = (typeof console !== "undefined" && console !== null ? console.error : void 0) != null; 14 | Out.prototype.has_console_log = function() { 15 | return hasConsoleLog; 16 | }; 17 | Out.prototype.has_console_error = function() { 18 | return hasConsoleError; 19 | }; 20 | Out.prototype.ut_error = function(txt) { 21 | var has_e; 22 | has_e = this.has_console_error(); 23 | if (has_e) { 24 | console.error(txt); 25 | } 26 | return has_e; 27 | }; 28 | Out.prototype.log = function(txt) { 29 | var has_l; 30 | has_l = this.has_console_log(); 31 | if (has_l && this.verbose) { 32 | console.log(txt); 33 | } 34 | return has_l; 35 | }; 36 | Out.prototype.ut = function(talky, name, txt) { 37 | if ((talky != null) && talky === true) { 38 | this.log("\n"); 39 | this.log(name); 40 | if (txt != null) { 41 | this.log(txt); 42 | } 43 | } 44 | return this.has_console_log(); 45 | }; 46 | return Out; 47 | })(); 48 | window.o = new Out(); 49 | }).call(this); 50 | -------------------------------------------------------------------------------- /inst/public/_scripts/rss.js: -------------------------------------------------------------------------------- 1 | function LoadDynamicFeedControl() { 2 | var feeds = [ 3 | { 4 | title: 'Inside-R', 5 | url: 'http://inside-r.org/blogs/feed' 6 | }]; 7 | var options = { 8 | displayTime: 10000, // milli sec 9 | transistionTime: 1500, // milli sec 10 | stacked : false, 11 | horizontal : true, 12 | title : "" 13 | } 14 | 15 | new GFdynamicFeedControl(feeds, 'feed-control', options); 16 | } 17 | // Load the feeds API and set the onload callback. 18 | google.load('feeds', '1'); 19 | google.setOnLoadCallback(LoadDynamicFeedControl); 20 | -------------------------------------------------------------------------------- /inst/public/_scripts/ui.achtung-min.js: -------------------------------------------------------------------------------- 1 | (function(a){a.fn.achtung=function(e){var b=(typeof e==="string"),d=Array.prototype.slice.call(arguments,0),c="achtung";return this.each(function(){var f=a.data(this,c);if(b&&e.substring(0,1)==="_"){return this}(!f&&!b&&a.data(this,c,new a.achtung(this))._init(d));(f&&b&&a.isFunction(f[e])&&f[e].apply(f,d.slice(1)))})};a.achtung=function(d){var b=Array.prototype.slice.call(arguments,0),c;if(!d||!d.nodeType){c=a("
    ");return c.achtung.apply(c,b)}this.$container=a(d)};a.extend(a.achtung,{version:"0.3.0",$overlay:false,defaults:{timeout:10,disableClose:false,icon:false,className:"",animateClassSwitch:false,showEffects:{opacity:"toggle",height:"toggle"},hideEffects:{opacity:"toggle" 2 | //,height:"toggle" 3 | },showEffectDuration:500,hideEffectDuration:700}});a.extend(a.achtung.prototype,{$container:false,closeTimer:false,options:{},_init:function(c){var d,b=this;c=a.isArray(c)?c:[];c.unshift(a.achtung.defaults);c.unshift({});d=this.options=a.extend.apply(a,c);if(!a.achtung.$overlay){a.achtung.$overlay=a('
    ').appendTo(document.body)}if(!d.disableClose){a('').click(function(){b.close()}).hover(function(){a(this).addClass("achtung-close-button-hover")},function(){a(this).removeClass("achtung-close-button-hover")}).prependTo(this.$container)}this.changeIcon(d.icon,true);if(d.message){this.$container.append(a(''+d.message+""))}(d.className&&this.$container.addClass(d.className));(d.css&&this.$container.css(d.css));this.$container.addClass("achtung").appendTo(a.achtung.$overlay);if(d.showEffects){this.$container.animate(d.showEffects,d.showEffectDuration)}else{this.$container.show()}if(d.timeout>0){this.timeout(d.timeout)}},timeout:function(c){var b=this;if(this.closeTimer){clearTimeout(this.closeTimer)}this.closeTimer=setTimeout(function(){b.close()},c*1000);this.options.timeout=c},changeClass:function(c){var b=this;if(this.options.className===c){return}this.$container.queue(function(){if(!b.options.animateClassSwitch||/webkit/.test(navigator.userAgent.toLowerCase())||!a.isFunction(a.fn.switchClass)){b.$container.removeClass(b.options.className);b.$container.addClass(c)}else{b.$container.switchClass(b.options.className,c,500)}b.options.className=c;b.$container.dequeue()})},changeIcon:function(c,d){var b=this;if((d!==true||c===false)&&this.options.icon===c){return}if(d||this.options.icon===false){this.$container.prepend(a(''));this.options.icon=c;return}else{if(c===false){this.$container.find(".achtung-message-icon").remove();this.options.icon=false;return}}this.$container.queue(function(){var e=a(".achtung-message-icon",b.$container);if(!b.options.animateClassSwitch||/webkit/.test(navigator.userAgent.toLowerCase())||!a.isFunction(a.fn.switchClass)){e.removeClass(b.options.icon);e.addClass(c)}else{e.switchClass(b.options.icon,c,500)}b.options.icon=c;b.$container.dequeue()})},changeMessage:function(b){this.$container.queue(function(){a(".achtung-message",a(this)).html(b);a(this).dequeue()})},update:function(b){(b.className&&this.changeClass(b.className));(b.css&&this.$container.css(b.css));(typeof(b.icon)!=="undefined"&&this.changeIcon(b.icon));(b.message&&this.changeMessage(b.message));(b.timeout&&this.timeout(b.timeout))},close:function(){var c=this.options,b=this.$container;if(c.hideEffects){this.$container.animate(c.hideEffects,c.hideEffectDuration)}else{this.$container.hide()}b.queue(function(){b.removeData("achtung");b.remove();if(a.achtung.$overlay&&a.achtung.$overlay.is(":empty")){a.achtung.$overlay.remove();a.achtung.$overlay=false}b.dequeue()})}})})(jQuery); -------------------------------------------------------------------------------- /inst/public/_styles/r-help.css: -------------------------------------------------------------------------------- 1 | /* Colour scheme: http://kuler.adobe.com/#themeID/163847 */ 2 | 3 | /* Basic layout ----------------------------------------------------------- */ 4 | 5 | #hd { 6 | padding: 0.5em; 7 | background-color: #eee; 8 | vertical-align: center; 9 | min-height: 19px; 10 | } 11 | #search { 12 | width: 15em 13 | } 14 | #hd form * {font-size: 0.9em;} 15 | #ft { 16 | font-size: 90%; 17 | background-color: #eee; 18 | padding-top: 1em; 19 | margin-top: 3em; 20 | margin-bottom: 0; 21 | padding-bottom: 0.5em; 22 | clear: both; 23 | } 24 | #ft p { 25 | margin-left: 1em; 26 | margin-bottom: 0.5em; 27 | margin-top: 0; 28 | } 29 | #ft p.load_html { 30 | margin-bottom: 0; 31 | } 32 | 33 | 34 | #bd { 35 | margin-left: 1em; 36 | } 37 | 38 | .content, .sidebar { 39 | float: left; 40 | margin-right: 1em; 41 | } 42 | .content { 43 | width: 100%; 44 | max-width: 600px; 45 | float: left; 46 | clear: all; 47 | } 48 | 49 | .clearDiv { 50 | padding: 0; 51 | margin: 0; 52 | clear:both; 53 | height: 1px; 54 | } 55 | .tight_bottom { 56 | margin-bottom: 0; 57 | padding-bottom: 0; 58 | } 59 | 60 | 61 | /* Sidebar */ 62 | .sidebars { 63 | float: left; 64 | } 65 | .narrow .sidebars { 66 | width: 100%; 67 | } 68 | 69 | .sidebar { 70 | width: 200px; 71 | } 72 | 73 | .sidebars .sidebar { 74 | background-color: #eee; 75 | padding: 0.5em; 76 | border-top-right-radius: 20px; 77 | -moz-border-top-right-radius: 20px; 78 | word-wrap: break-word; 79 | } 80 | 81 | .sidebars .sidebar h2 { 82 | font-size: 1.2em; 83 | } 84 | .sidebar h2:first-child, .content h2:first-child { 85 | margin-top: 0; 86 | } 87 | .sidebars ul, .sidebars ol {margin-left: 1em; padding-left: 0.5em} 88 | 89 | .sidebars p, .sidebars li {margin: 0.25em 0 0.25em 0} 90 | .sidebars td {padding: 0px;} 91 | 92 | p.description {margin: 0 1em 1em 0;} 93 | 94 | /* Basic styles ----------------------------------------------------------- */ 95 | 96 | body { 97 | margin: 0; 98 | font-family: "Helvetica Neue", Helvetica, Arial, "sans serif"; 99 | } 100 | body * { 101 | margin-bottom: 0.5em; line-height: 1.5em; 102 | } 103 | #ft a, #ft img {margin-bottom: 0} 104 | 105 | 106 | a:link, a:visited { color: #264D66;} 107 | a:hover {background-color: #ccc; color: #264D66;} 108 | 109 | tr {text-align: left;} 110 | td {vertical-align: top; padding: 4px;} 111 | .search_table tbody tr td {vertical-align: top; padding: 0 0 0 4px;} 112 | ul {margin-left: 2em; margin-bottom: 0.5em; } 113 | ul li {list-style-type: disc;} 114 | 115 | h1 { 116 | font-size: 3em; 117 | font-weight: normal; 118 | line-height: 1.2em; 119 | margin-bottom: 0.25em 120 | } 121 | h2, search_title { 122 | font-size: 1.4em; 123 | font-weight: bold; 124 | margin-top: 1em; 125 | color: #264D66; 126 | } 127 | h3 {font-weight: bold;} 128 | 129 | .change_log_date, .load_html { 130 | color: rgb(177,177,177); 131 | } 132 | 133 | em {font-style: italic;} 134 | strong {font-weight: bold;} 135 | 136 | pre, code { 137 | font-size: 0.97em; 138 | background-color: #eaeaea; 139 | white-space: pre-wrap; 140 | } 141 | pre, code, pre * { 142 | font-family: monospace; 143 | } 144 | 145 | pre { 146 | margin-bottom: 0; 147 | } 148 | 149 | /* Topic listing */ 150 | 151 | ul.topics, ul.topics li {list-style: none; margin-left: 0; padding-left: 0} 152 | .topics code {background-color: #ddd; padding: 2px} 153 | 154 | /* Watermark -------------------------------------------------------------- */ 155 | 156 | #watermark { 157 | letter-spacing: -15px; 158 | position: fixed; 159 | left: 30px; 160 | top: 50px; 161 | font-size: 200px; 162 | margin-top: 0; 163 | line-height: 1; 164 | font-weight: bold; 165 | /* color: #f0f0f6;*/ 166 | color: #F7F7FC; 167 | z-index: -5; 168 | } 169 | 170 | /* Syntax highlighting ---------------------------------------------------- */ 171 | 172 | .number {color:rgb(21,20,181);} 173 | .functioncall {color:#264D66 ;} 174 | .string {color:#375D81 ;} 175 | .keyword {font-weight:bolder ;color:black;} 176 | .argument {color:#264D66 ;} 177 | .comment {color: #333;} 178 | .formalargs {color: #264D66;} 179 | .eqformalargs {color:#264D66;} 180 | .packages_installed .packages_old {color:rgb(150,182,37);} 181 | .slot {font-style:italic;} 182 | .symbol {color:black ;} 183 | .prompt {color:black ;} 184 | .R_output {background-color: rgb(221,232,235) ! important;} 185 | .R_output_image { 186 | border-width: 2px ! important; border-style: solid; 187 | background-color: rgb(255,255,255); 188 | border-color: rgb(135,179,190); /* darker output blue */ 189 | display: block; 190 | margin-left: auto; 191 | margin-right: auto; 192 | } 193 | .R_output, .R_output_image { 194 | margin-top: 0.5em ! important; 195 | margin-bottom: 0.5em ! important; 196 | } 197 | 198 | /* Home page -------------------------------------------------------------- */ 199 | 200 | #feed-control { 201 | /* width: 150px;*/ 202 | /* max-width: 530px !important;*/ 203 | float: left; 204 | } 205 | 206 | #feed-control, #feed-control .gfg-horizontal-root { 207 | /* font-size: 0.7em !important;*/ 208 | /* line-height: 0.8em !important;*/ 209 | padding: 0px !important; 210 | } 211 | 212 | #feed-control span { 213 | color: #676767; 214 | } 215 | 216 | #feed-control .gfg-branding { 217 | display: none; 218 | } 219 | 220 | 221 | #packages.loaded .installed, #thinking_wheel {display: none;} 222 | 223 | .out_of_date { background-color: #FE8080;} 224 | .updated { background-color: rgba(238,238,238,.5);} 225 | .old a:link, .old a:visited {color: red;} 226 | .old { position: relative;} 227 | .single_install_button { margin-bottom:0em ! important; margin-right: 4px;} 228 | 229 | #thinking_wheel{ 230 | margin: 0; 231 | line-height: 16px; 232 | width: 16px; 233 | height: 16px; 234 | } 235 | 236 | #yui-main { 237 | margin-left: 1em; 238 | } 239 | 240 | /* Search ----------------------------------------------------------------- */ 241 | 242 | #search_bar { 243 | background-color: #EEE; 244 | position: absolute; 245 | top: 5px; 246 | right: 5px; 247 | display: inline-block; 248 | padding-left: 20px; 249 | } 250 | #search_bar form { 251 | margin-bottom: 0px; 252 | } 253 | 254 | .helpr_prev_next { 255 | text-align: right; 256 | font-size: 1.5em; 257 | } 258 | .highlight { background-color: rgb(255,255,102) } 259 | #remove_highlight_button { float: right}; 260 | -------------------------------------------------------------------------------- /inst/public/_styles/reset-fonts.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009, Yahoo! Inc. All rights reserved. 3 | Code licensed under the BSD License: 4 | http://developer.yahoo.net/yui/license.txt 5 | version: 2.8.0r4 6 | */ 7 | html{color:#000}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var,optgroup{font-style:inherit;font-weight:inherit;}del,ins{text-decoration:none;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:baseline;}sub{vertical-align:baseline;}legend{color:#000;}input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}input,button,textarea,select{*font-size:100%;}body{font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}select,input,button,textarea,button{font:99% arial,helvetica,clean,sans-serif;}table{font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;} -------------------------------------------------------------------------------- /inst/public/_styles/ui.achtung-min.css: -------------------------------------------------------------------------------- 1 | * html #achtung-overlay{position:absolute;}* html .achtung{width:280px;}#achtung-overlay{overflow:hidden;position:fixed;top:15px;right:15px;width:280px;z-index:50;}.achtung{display:none;margin-bottom:8px;padding:15px 15px;background-color:#000;color:white;width:250px;font-weight:bold;position:relative;overflow:hidden;-moz-box-shadow:#aaa 1px 1px 2px;-webkit-box-shadow:#aaa 1px 1px 2px;box-shadow:#aaa 1px 1px 2px;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;opacity:.85;filter:Alpha(Opacity=85);}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat;}.ui-icon{width:16px;height:16px;background-image:url(/_images/ui-icons_222222_256x240.png);}.ui-icon-carat-1-n{background-position:0 0;}.ui-icon-carat-1-ne{background-position:-16px 0;}.ui-icon-carat-1-e{background-position:-32px 0;}.ui-icon-carat-1-se{background-position:-48px 0;}.ui-icon-carat-1-s{background-position:-64px 0;}.ui-icon-carat-1-sw{background-position:-80px 0;}.ui-icon-carat-1-w{background-position:-96px 0;}.ui-icon-carat-1-nw{background-position:-112px 0;}.ui-icon-carat-2-n-s{background-position:-128px 0;}.ui-icon-carat-2-e-w{background-position:-144px 0;}.ui-icon-triangle-1-n{background-position:0 -16px;}.ui-icon-triangle-1-ne{background-position:-16px -16px;}.ui-icon-triangle-1-e{background-position:-32px -16px;}.ui-icon-triangle-1-se{background-position:-48px -16px;}.ui-icon-triangle-1-s{background-position:-64px -16px;}.ui-icon-triangle-1-sw{background-position:-80px -16px;}.ui-icon-triangle-1-w{background-position:-96px -16px;}.ui-icon-triangle-1-nw{background-position:-112px -16px;}.ui-icon-triangle-2-n-s{background-position:-128px -16px;}.ui-icon-triangle-2-e-w{background-position:-144px -16px;}.ui-icon-arrow-1-n{background-position:0 -32px;}.ui-icon-arrow-1-ne{background-position:-16px -32px;}.ui-icon-arrow-1-e{background-position:-32px -32px;}.ui-icon-arrow-1-se{background-position:-48px -32px;}.ui-icon-arrow-1-s{background-position:-64px -32px;}.ui-icon-arrow-1-sw{background-position:-80px -32px;}.ui-icon-arrow-1-w{background-position:-96px -32px;}.ui-icon-arrow-1-nw{background-position:-112px -32px;}.ui-icon-arrow-2-n-s{background-position:-128px -32px;}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px;}.ui-icon-arrow-2-e-w{background-position:-160px -32px;}.ui-icon-arrow-2-se-nw{background-position:-176px -32px;}.ui-icon-arrowstop-1-n{background-position:-192px -32px;}.ui-icon-arrowstop-1-e{background-position:-208px -32px;}.ui-icon-arrowstop-1-s{background-position:-224px -32px;}.ui-icon-arrowstop-1-w{background-position:-240px -32px;}.ui-icon-arrowthick-1-n{background-position:0 -48px;}.ui-icon-arrowthick-1-ne{background-position:-16px -48px;}.ui-icon-arrowthick-1-e{background-position:-32px -48px;}.ui-icon-arrowthick-1-se{background-position:-48px -48px;}.ui-icon-arrowthick-1-s{background-position:-64px -48px;}.ui-icon-arrowthick-1-sw{background-position:-80px -48px;}.ui-icon-arrowthick-1-w{background-position:-96px -48px;}.ui-icon-arrowthick-1-nw{background-position:-112px -48px;}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px;}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px;}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px;}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px;}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px;}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px;}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px;}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px;}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px;}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px;}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px;}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px;}.ui-icon-arrowreturn-1-w{background-position:-64px -64px;}.ui-icon-arrowreturn-1-n{background-position:-80px -64px;}.ui-icon-arrowreturn-1-e{background-position:-96px -64px;}.ui-icon-arrowreturn-1-s{background-position:-112px -64px;}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px;}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px;}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px;}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px;}.ui-icon-arrow-4{background-position:0 -80px;}.ui-icon-arrow-4-diag{background-position:-16px -80px;}.ui-icon-extlink{background-position:-32px -80px;}.ui-icon-newwin{background-position:-48px -80px;}.ui-icon-refresh{background-position:-64px -80px;}.ui-icon-shuffle{background-position:-80px -80px;}.ui-icon-transfer-e-w{background-position:-96px -80px;}.ui-icon-transferthick-e-w{background-position:-112px -80px;}.ui-icon-folder-collapsed{background-position:0 -96px;}.ui-icon-folder-open{background-position:-16px -96px;}.ui-icon-document{background-position:-32px -96px;}.ui-icon-document-b{background-position:-48px -96px;}.ui-icon-note{background-position:-64px -96px;}.ui-icon-mail-closed{background-position:-80px -96px;}.ui-icon-mail-open{background-position:-96px -96px;}.ui-icon-suitcase{background-position:-112px -96px;}.ui-icon-comment{background-position:-128px -96px;}.ui-icon-person{background-position:-144px -96px;}.ui-icon-print{background-position:-160px -96px;}.ui-icon-trash{background-position:-176px -96px;}.ui-icon-locked{background-position:-192px -96px;}.ui-icon-unlocked{background-position:-208px -96px;}.ui-icon-bookmark{background-position:-224px -96px;}.ui-icon-tag{background-position:-240px -96px;}.ui-icon-home{background-position:0 -112px;}.ui-icon-flag{background-position:-16px -112px;}.ui-icon-calendar{background-position:-32px -112px;}.ui-icon-cart{background-position:-48px -112px;}.ui-icon-pencil{background-position:-64px -112px;}.ui-icon-clock{background-position:-80px -112px;}.ui-icon-disk{background-position:-96px -112px;}.ui-icon-calculator{background-position:-112px -112px;}.ui-icon-zoomin{background-position:-128px -112px;}.ui-icon-zoomout{background-position:-144px -112px;}.ui-icon-search{background-position:-160px -112px;}.ui-icon-wrench{background-position:-176px -112px;}.ui-icon-gear{background-position:-192px -112px;}.ui-icon-heart{background-position:-208px -112px;}.ui-icon-star{background-position:-224px -112px;}.ui-icon-link{background-position:-240px -112px;}.ui-icon-cancel{background-position:0 -128px;}.ui-icon-plus{background-position:-16px -128px;}.ui-icon-plusthick{background-position:-32px -128px;}.ui-icon-minus{background-position:-48px -128px;}.ui-icon-minusthick{background-position:-64px -128px;}.ui-icon-close{background-position:-80px -128px;}.ui-icon-closethick{background-position:-96px -128px;}.ui-icon-key{background-position:-112px -128px;}.ui-icon-lightbulb{background-position:-128px -128px;}.ui-icon-scissors{background-position:-144px -128px;}.ui-icon-clipboard{background-position:-160px -128px;}.ui-icon-copy{background-position:-176px -128px;}.ui-icon-contact{background-position:-192px -128px;}.ui-icon-image{background-position:-208px -128px;}.ui-icon-video{background-position:-224px -128px;}.ui-icon-script{background-position:-240px -128px;}.ui-icon-alert{background-position:0 -144px;}.ui-icon-info{background-position:-16px -144px;}.ui-icon-notice{background-position:-32px -144px;}.ui-icon-help{background-position:-48px -144px;}.ui-icon-check{background-position:-64px -144px;}.ui-icon-bullet{background-position:-80px -144px;}.ui-icon-radio-off{background-position:-96px -144px;}.ui-icon-radio-on{background-position:-112px -144px;}.ui-icon-pin-w{background-position:-128px -144px;}.ui-icon-pin-s{background-position:-144px -144px;}.ui-icon-play{background-position:0 -160px;}.ui-icon-pause{background-position:-16px -160px;}.ui-icon-seek-next{background-position:-32px -160px;}.ui-icon-seek-prev{background-position:-48px -160px;}.ui-icon-seek-end{background-position:-64px -160px;}.ui-icon-seek-first{background-position:-80px -160px;}.ui-icon-stop{background-position:-96px -160px;}.ui-icon-eject{background-position:-112px -160px;}.ui-icon-volume-off{background-position:-128px -160px;}.ui-icon-volume-on{background-position:-144px -160px;}.ui-icon-power{background-position:0 -176px;}.ui-icon-signal-diag{background-position:-16px -176px;}.ui-icon-signal{background-position:-32px -176px;}.ui-icon-battery-0{background-position:-48px -176px;}.ui-icon-battery-1{background-position:-64px -176px;}.ui-icon-battery-2{background-position:-80px -176px;}.ui-icon-battery-3{background-position:-96px -176px;}.ui-icon-circle-plus{background-position:0 -192px;}.ui-icon-circle-minus{background-position:-16px -192px;}.ui-icon-circle-close{background-position:-32px -192px;}.ui-icon-circle-triangle-e{background-position:-48px -192px;}.ui-icon-circle-triangle-s{background-position:-64px -192px;}.ui-icon-circle-triangle-w{background-position:-80px -192px;}.ui-icon-circle-triangle-n{background-position:-96px -192px;}.ui-icon-circle-arrow-e{background-position:-112px -192px;}.ui-icon-circle-arrow-s{background-position:-128px -192px;}.ui-icon-circle-arrow-w{background-position:-144px -192px;}.ui-icon-circle-arrow-n{background-position:-160px -192px;}.ui-icon-circle-zoomin{background-position:-176px -192px;}.ui-icon-circle-zoomout{background-position:-192px -192px;}.ui-icon-circle-check{background-position:-208px -192px;}.ui-icon-circlesmall-plus{background-position:0 -208px;}.ui-icon-circlesmall-minus{background-position:-16px -208px;}.ui-icon-circlesmall-close{background-position:-32px -208px;}.ui-icon-squaresmall-plus{background-position:-48px -208px;}.ui-icon-squaresmall-minus{background-position:-64px -208px;}.ui-icon-squaresmall-close{background-position:-80px -208px;}.ui-icon-grip-dotted-vertical{background-position:0 -224px;}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px;}.ui-icon-grip-solid-vertical{background-position:-32px -224px;}.ui-icon-grip-solid-horizontal{background-position:-48px -224px;}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px;}.ui-icon-grip-diagonal-se{background-position:-80px -224px;}.achtung .achtung-message-icon{margin-top:0;margin-left:-.5em;margin-right:.5em;float:left;zoom:1;}.achtung .ui-icon.achtung-close-button{overflow:hidden;float:right;position:relative;top:-8px;right:-8px;cursor:pointer;background-image:url(/_images/ui-icons_cccccc_256x240.png);}.achtung .ui-icon.achtung-close-button-hover{background-image:url(/_images/ui-icons_ffffff_256x240.png);}.achtungSuccess,.achtungFail,.achtungWait{opacity:.93;filter:Alpha(Opacity=93);}.achtungSuccess{background-color:#4DB559;}.achtungFail{background-color:#D64450;}.achtungWait{background-color:#658093;}.achtungSuccess .ui-icon.achtung-close-button,.achtungFail .ui-icon.achtung-close-button{background-image:url(/_images/ui-icons_444444_256x240.png);}.achtungSuccess .ui-icon.achtung-close-button-hover,.achtungFail .ui-icon.achtung-close-button-hover{background-image:url(/_images/ui-icons_000000_256x240.png);}.achtung .wait-icon{background-image:url('images/wait.gif');}.achtung .achtung-message{display:inline;} -------------------------------------------------------------------------------- /inst/public/_tmp_pictures/.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hadley/helpr/2eeb174b09493f8d5c4c072772285c100f410a29/inst/public/_tmp_pictures/.png -------------------------------------------------------------------------------- /inst/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hadley/helpr/2eeb174b09493f8d5c4c072772285c100f410a29/inst/public/favicon.ico -------------------------------------------------------------------------------- /inst/views/_analytics.html: -------------------------------------------------------------------------------- 1 | 14 | 15 | -------------------------------------------------------------------------------- /inst/views/_changelogs.html: -------------------------------------------------------------------------------- 1 | <% if(dataframe_has_rows(news)) {-%> 2 |

    Changes <%= if(!is.na(date)) {str_c(" ",date,"") } %>

    3 | <% for(i in seq_along(names(news))) { -%> 4 | <% if(has_text(news[[i]])) {-%> 5 | <% news_name <- names(news)[i] %> 6 | <%= if(!is.na(news_name)){ str_c("

    ",news_name,"

    ") } %> 7 | <%= str_c("
    • ",str_c(news[[i]], collapse="
    • ") ,"
    ") %> 8 | <% } %> 9 | <% } %> 10 | <% } %> 11 | -------------------------------------------------------------------------------- /inst/views/_changelogs_topic_source.html: -------------------------------------------------------------------------------- 1 | <%= str_c("

    ",title,"

    ") %> 2 | <% for(i in names(news)) { -%> 3 | <% if(has_text(news[[i]])) {-%> 4 |
    5 | <%= if(!is.na(i)) str_c("
    ",i,"
    ") %> 6 |
    7 | <%= str_c(news[[i]], collapse="
    ") %> 8 |
    9 |
    10 | <% } %> 11 | <% } %> 12 | -------------------------------------------------------------------------------- /inst/views/_disqus.html: -------------------------------------------------------------------------------- 1 | <% if(FALSE && i_can_has_internetz()) {-%> 2 | 3 |
    4 |
    5 | 6 | 7 | 41 | 42 | <% } %> 43 | -------------------------------------------------------------------------------- /inst/views/_facebook.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 | <% facebookUrl = paste("http://127.0.0.1/R/helpr", url, sep="") %> 4 |
    5 | 12 | 13 |
    14 | 15 | 16 | 17 |
    18 | -------------------------------------------------------------------------------- /inst/views/_footer.html: -------------------------------------------------------------------------------- 1 |
    2 |

    helpr: elegant R help. By Barret Schloerke and Hadley Wickham.

    3 | 4 |

    Package development sponsored by . Search sponsored by .

    5 | 6 |

    load_html("<%= html %>")

    7 |
    8 | -------------------------------------------------------------------------------- /inst/views/_function_list.html: -------------------------------------------------------------------------------- 1 | <% if(dataframe_has_rows(d) ) { -%> 2 |

    <%= title %>

    3 | 8 | <% } %> 9 | -------------------------------------------------------------------------------- /inst/views/_google_dynamic_feed.html: -------------------------------------------------------------------------------- 1 | <% if(i_can_has_internetz()) {-%> 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | <% } %> 16 | -------------------------------------------------------------------------------- /inst/views/_growl.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /inst/views/_html_header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 9 | 11 | 13 | 14 | 49 | -------------------------------------------------------------------------------- /inst/views/_next_previous.html: -------------------------------------------------------------------------------- 1 | <%# "layout from failblog.org" %> 2 | <% if(ceiling(total_item_count/row_count) > 1){ -%> 3 | 4 | <% if(start_pos != 0){ -%> 5 | <%= str_c("") %>≪ Previous 6 | <% } %> 7 | 8 | <% for(i in (seq_len(ceiling(total_item_count/row_count))-1)){ -%> 9 | <% if(i == floor(start_pos / row_count)) { -%> 10 | [<%= i+1 %>] 11 | <% }else{ %> 12 | <%= str_c("") %><%= i+1 %> 13 | <% } %> 14 | <% } %> 15 | 16 | <% if((row_count+start_pos) < total_item_count){ -%> 17 | <%= str_c("") %>Next ≫ 18 | <% } %> 19 | 20 | <% } %> 21 | -------------------------------------------------------------------------------- /inst/views/_next_previous_in_table.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <% if(start_pos != 0){ -%> 6 | 12 | <% }else{ -%> 13 | 14 | <% } %> 15 | 16 | 17 | <% for(i in (seq_len(ceiling(total_item_count/helpr_search_row_count))-1)){ -%> 18 | 31 | <% } %> 32 | 33 | 34 | <% if((row_count+start_pos) < total_item_count){ -%> 35 | 36 | <% }else{ -%> 37 | 38 | <% } %> 39 | 40 |
    7 | <%= str_c("") %> 8 | < h
    9 | Previous 10 |
    11 |
    h 19 | <% cur <- i == floor(start_pos / helpr_search_row_count) %> 20 | <% if(!cur) { -%> 21 | <%= str_c("") %> 22 | <% } %> 23 | 24 | e
    25 | <%= i+1 %> 26 | 27 | <% if(!cur) { -%> 28 |
    29 | <% } %> 30 |
    lpr >
    Next
    lpr
    41 | <%= total_item_count %> 42 | 43 | 44 | -------------------------------------------------------------------------------- /inst/views/_package_topic_desc.html: -------------------------------------------------------------------------------- 1 |

    2 | ><%= pkg %> 3 | :: 4 | <% if(is.null(query)) query_string <- "" else query_string <- str_c("?h=", query) %> 5 | ><%= topic %> 6 |

    7 | <% content <- sapply(items, as.character) %> 8 | <%# item_category <- str_c("",str_replace_all(names(item), "_t", ""), ": ", sep="") %> 9 | <%# content <- str_c("",item_category, "",as.character(item),"", collapse = "") %> 10 | 11 | <%# str_c("",as.character(item),"", collapse = "") %> 12 | <%# }) %> 13 | <% a <<- content %> 14 | <%= str_c("
    ", str_c(content, collapse = "
    "), "
    ", collapse = "") %> 15 | -------------------------------------------------------------------------------- /inst/views/_rating.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /inst/views/_search_bar.html: -------------------------------------------------------------------------------- 1 | <% if(i_can_has_internetz()) {-%> 2 | 8 | <% } %> 9 | -------------------------------------------------------------------------------- /inst/views/_top_functions.html: -------------------------------------------------------------------------------- 1 | <% if(dataframe_has_rows(functions)) { -%> 2 |

    <%= title %>

    3 |
      4 | <% for(i in seq_along(functions$count)) { -%> 5 |
    • 6 | <%= str_c( "", functions$name[i]," - ", functions$count[i]) %> 7 |
    • 8 | <% } %> 9 |
    10 | <% } %> 11 | -------------------------------------------------------------------------------- /inst/views/demo.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | <%= render_snippet("html_header") %> 8 | <%= render_snippet("growl") %> 9 | 10 | 11 | 12 | <%= package %> <%= name %>. R help 13 | 14 | 19 | 20 | 21 | 22 |
    <%= package %>
    23 | 24 |
    25 | R<%= package %> → <%= name %> (demo) 26 | <%= render_snippet("search_bar") %> 27 |
    28 | 29 |
    30 |
    31 |

    <%= name %>

    32 |

    <%= description %>

    33 | 34 | 35 | 36 |
    37 | <%= src %> 38 |
    39 |
    40 | 63 | 64 |
    65 | 66 | <%= render_snippet("facebook", list(url = str_c("/package/", package, "/demo/", name)) ) %> 67 | <%= render_snippet("footer", list(disqus = TRUE, html = html)) %> 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /inst/views/help.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | R help 15 | 16 | 17 | 18 |
    help
    19 |
    20 |
    21 | R 22 | <%= render_snippet("search_bar") %> 23 |
    24 | 25 |
    26 |
    27 |
    28 |

    Multiple Topics

    29 | 30 | <% for(i in seq_along(pkg)){ -%> 31 | <%= render_snippet("package_topic_desc", list(pkg = pkg[i], topic = topic[i], items = desc[i])) %> 32 | <% } %> 33 | 34 |
    35 |
    36 |
    37 |
    38 | <%= render_snippet("footer", list(disqus = FALSE, html = html)) %> 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /inst/views/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <%= render_snippet("html_header") %> 6 | <%= render_snippet("google_dynamic_feed") %> 7 | <%= render_snippet("growl") %> 8 | 9 | 11 | 13 | 14 | R help 15 | 16 | 17 | 18 |
    packages
    19 | 20 | <% if(i_can_has_internetz()) {-%> 21 |
    22 |   23 | 24 | <%= render_snippet("search_bar") %> 25 |
    26 | <% } %> 27 | 28 |
    29 |
    30 |

    R documentation

    31 |
    32 | 33 | 34 | 35 | 36 | 37 | 38 | <% for(i in seq_len(NROW(packages))) { -%> 39 | " class="<%= packages[i,"status"] %>"> 40 | 41 | 42 | 43 | <% } -%> 44 | 45 | 48 | 49 |
    Name Description
    "><%= packages[i,"Package"] %><%= packages[i,"Title"] %>
    46 | 47 |
    50 |
    51 | 52 | 87 |
    88 | 89 | 90 | <%= render_snippet("footer", list(html = html)) %> 91 | 92 | 93 | -------------------------------------------------------------------------------- /inst/views/package.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | <%= render_snippet("html_header") %> 7 | 9 | 10 | <%= package %>. R help 11 | 12 | 13 | 14 |
    <%= package %>
    15 |
    16 | R → <%= package %> 17 | <%= render_snippet("search_bar") %> 18 |
    19 | 20 |
    21 |

    <%= package %>

    22 | 23 |
    24 |

    <%= description$description %>

    25 | 26 | <% if(dataframe_has_rows(items$info)){ -%> 27 |

    Package Info

    28 |
      29 | <% for(topic in items$info) { -%> 30 |
    • <%= str_c("", topic$alias, "", collapse = ", ") %> <%= topic$title %>
    • 31 | <% } %> 32 |
    33 | <% } %> 34 | 35 | <% if(dataframe_has_rows(items$func)){ -%> 36 |

    Functions

    37 |
      38 | <% for(topic in items$func) { -%> 39 |
    • <%= str_c("", topic$alias, "", collapse = ", ") %> <%= topic$title %>
    • 40 | <% } %> 41 |
    42 | <% } -%> 43 | 44 | <% if(dataframe_has_rows(items$dataset)){ -%> 45 |

    Data

    46 |
      47 | <% for(topic in items$dataset) { -%> 48 |
    • <%= str_c("", topic$alias, "", collapse = ", ") %> <%= topic$title %>
    • 49 | <% } %> 50 |
    51 | <% } %> 52 | 53 |
    54 | 147 | 148 |
    149 | 150 |
    151 | <%= render_snippet("facebook", list(url = str_c("/package/", package)) ) %> 152 | <%= render_snippet("footer", list(html = html)) %> 153 | 154 | 155 | -------------------------------------------------------------------------------- /inst/views/search.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | R help 15 | 16 | 17 | 18 |
    search
    19 |
    20 |
    21 | R 22 | <%= render_snippet("search_bar") %> 23 |
    24 | 25 |
    26 |
    27 |

    Results for: "<%= query %>"

    28 | 29 | 30 | <% if(length(urls) < 1){ -%> 31 | 32 | 33 | Your search - <%= query %> - did not match any documents.
    34 |
    35 | Suggestions:
    36 |
      37 |
    • Make sure all words are spelled correctly.
    • 38 |
    • Try different keywords.
    • 39 |
    • Try more general keywords.
    • 40 |
    • Try fewer keywords.
    • 41 |
    42 | <% } %> 43 | 44 | <% for(i in seq_along(urls)){ -%> 45 | <% pkg_and_topic = package_and_topic_from_url(urls[i]) %> 46 | <%= render_snippet("package_topic_desc", list(pkg = pkg_and_topic$pkg, topic = pkg_and_topic$topic, items = items[[i]], query = query)) %> 47 | <% } %> 48 |
    49 | <%= render_snippet("next_previous", list( 50 | query = query, 51 | start_pos = start_pos, 52 | row_count = row_count, 53 | total_item_count = total_item_count 54 | )) %> 55 | 56 |
    57 |
    58 | 59 | 60 |
    61 | <%= render_snippet("footer", list(disqus = FALSE, html = html)) %> 62 | 63 | 64 | -------------------------------------------------------------------------------- /inst/views/source.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | <%= render_snippet("html_header") %> 7 | <%= package %> <%= name %>. R help 8 | 9 | 10 | 11 |
    <%= name %>
    12 |
    13 | R → 14 | <%= package %> → 15 | <%= topic %> → 16 | <%= name %> (source) 17 |
    18 |
    19 |

    <%= name %>

    20 |
    21 | <%= desc %> 22 | 23 |

    <%= name %> Source

    24 | <%= src %> 25 | 26 | <% if(!is.null(change_log)) {- %> 27 | <%= render_snippet("changelogs_topic_source", change_log) %> 28 | <% } %> 29 |
    30 | 51 | 52 |
    53 | 54 | <%= render_snippet("facebook", list(url = str_c("/package/", package, "/topic/", name, "/source")) ) %> 55 | <%= render_snippet("footer", list(disqus = TRUE, html = html)) %> 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /inst/views/topic.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | <%= render_snippet("html_header") %> 7 | <%= render_snippet("growl") %> 8 | 9 | 11 | 18 | 19 | <%= name %> / <%= package %>. R help 20 | 21 | 22 | 23 |
    <%= name %>
    24 | 25 |
    26 | R → 27 | <%= package %> → <%= name %> 28 | <% if (length(aliases) > 0) { %> (aka <%= str_c(aliases, collapse = ", ") %>) <% } %> 29 | <% if (nchar(highlight) > 0) { -%> 30 | 31 | 36 | <% } %> 37 | <%= render_snippet("search_bar") %> 38 |
    39 | 40 |
    41 |

    <%= title%>

    42 | 43 |
    44 |

    <%= desc %>

    45 | 46 | <% if(has_text(usage)){ -%> 47 |

    Usage

    48 |

    Click the functions to view their source

    49 |
    <%= usage %>
    50 | <% } %> 51 | 52 | <% if(dataframe_has_rows(params$args) || has_text(params$pre_text) || has_text(params$post_text)){ -%> 53 |

    Arguments

    54 | <%= params$pre_text %> 55 | 56 | <% for(param in params$args) { -%> 57 | 58 | 59 | 60 | 61 | <% } -%> 62 |
    <%= param$param %><%= param$desc %>
    63 | <%= params$post_text %> 64 | <% } %> 65 | 66 | <% if(has_text(details)){ -%> 67 |

    Details

    <%= details %> 68 | <% }%> 69 | 70 | <% if(has_text(value)){ -%> 71 |

    Value

    <%= value %> 72 | <% }%> 73 | 74 | <% if(has_text(sections)){ -%> 75 |

    Sections

    <%= sections %> 76 | <% }%> 77 | 78 | <% if(has_text(source)){ -%> 79 |

    Source

    <%= source %> 80 | <% }%> 81 | 82 | 83 |
    84 | 106 | 107 |
    108 | 109 | <% if(dataframe_has_rows(examples)){ -%> 110 |
    111 |

    Examples

    112 | 113 | 114 | 115 | 116 |
    117 | <%= examples %> 118 |
    119 |
    120 | 121 | 122 | <% if(dataframe_has_rows(topic_in_example)) { -%> 123 | 128 | <% } %> 129 | <% } %> 130 | 131 |
    132 | 133 | <%= render_snippet("facebook", list(url = str_c("/package/", package, "/topic/", name)) ) %> 134 | <%= render_snippet("footer", list(html = html)) %> 135 | 136 | 137 | -------------------------------------------------------------------------------- /inst/views/whistle.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | <%= render_snippet("html_header") %> 7 | 8 | <%= render_snippet("growl") %> 9 | 10 | whistle while you work ... 11 | 12 | 13 | 14 |
    ... waiting ...
    15 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /man/add_function_links_into_parsed.Rd: -------------------------------------------------------------------------------- 1 | \name{add_function_links_into_parsed} 2 | \alias{add_function_links_into_parsed} 3 | \title{Add funciton link. 4 | Add the function link to the preparsed R code} 5 | \usage{ 6 | add_function_links_into_parsed(parser_output, source_link 7 | = FALSE) 8 | } 9 | \arguments{ 10 | \item{parser_output}{pre-parsed output} 11 | } 12 | \value{ 13 | parsed output with functions with html links around them 14 | } 15 | \description{ 16 | Add funciton link. Add the function link to the preparsed 17 | R code 18 | } 19 | \author{ 20 | Barret Schloerke 21 | } 22 | \keyword{internal} 23 | 24 | -------------------------------------------------------------------------------- /man/add_package_link_to_string.Rd: -------------------------------------------------------------------------------- 1 | \name{add_package_link_to_string} 2 | \alias{add_package_link_to_string} 3 | \title{Add package link to a string.} 4 | \usage{ 5 | add_package_link_to_string(string) 6 | } 7 | \arguments{ 8 | \item{string}{string to be evaluated} 9 | } 10 | \description{ 11 | Add package link to a string. 12 | } 13 | \examples{ 14 | #add_package_link_to_string("quantreg, Hmisc, mapproj, maps, hexbin, gpclib, maptools") 15 | } 16 | \author{ 17 | Barret Schloerke 18 | } 19 | \keyword{internal} 20 | 21 | -------------------------------------------------------------------------------- /man/author_email.Rd: -------------------------------------------------------------------------------- 1 | \name{author_email} 2 | \alias{author_email} 3 | \title{Author Email Parsing 4 | parse the author email} 5 | \usage{ 6 | author_email(name, address) 7 | } 8 | \arguments{ 9 | \item{name}{name of the email} 10 | 11 | \item{address}{email address} 12 | } 13 | \description{ 14 | Author Email Parsing parse the author email 15 | } 16 | \author{ 17 | Barret Schloerke 18 | } 19 | \keyword{internal} 20 | 21 | -------------------------------------------------------------------------------- /man/base_html_path.Rd: -------------------------------------------------------------------------------- 1 | \name{base_html_path} 2 | \alias{base_html_path} 3 | \title{Base html path needed to load a website.} 4 | \arguments{ 5 | \item{...}{site to be loaded} 6 | } 7 | \description{ 8 | Base html path needed to load a website. 9 | } 10 | \author{ 11 | Barret Schloerke 12 | } 13 | \keyword{internal} 14 | 15 | -------------------------------------------------------------------------------- /man/body_text.Rd: -------------------------------------------------------------------------------- 1 | \name{body_text} 2 | \alias{body_text} 3 | \title{Extract source code of a function.} 4 | \usage{ 5 | body_text(package, fun) 6 | } 7 | \arguments{ 8 | \item{fun}{name of function to get the source code from} 9 | } 10 | \value{ 11 | NULL or source code of of the function 12 | } 13 | \description{ 14 | Extract source code of a function. 15 | } 16 | \author{ 17 | Barret Schloerke \email{schloerke@gmail.con} and Hadley 18 | Wickham 19 | } 20 | \keyword{internal} 21 | 22 | -------------------------------------------------------------------------------- /man/check_for_package.Rd: -------------------------------------------------------------------------------- 1 | \name{check_for_package} 2 | \alias{check_for_package} 3 | \title{Check to see if a package exists.} 4 | \usage{ 5 | check_for_package(package) 6 | } 7 | \arguments{ 8 | \item{package}{package in question} 9 | } 10 | \description{ 11 | Check to see if a package exists. 12 | } 13 | \examples{ 14 | #check_for_package("stats") 15 | #check_for_package("does_not_exist") 16 | } 17 | \author{ 18 | Barret Schloerke 19 | } 20 | \keyword{internal} 21 | 22 | -------------------------------------------------------------------------------- /man/code_info.Rd: -------------------------------------------------------------------------------- 1 | \name{code_info} 2 | \alias{code_info} 3 | \title{Find functions, counts, and links of given R text.} 4 | \usage{ 5 | code_info(parser_output) 6 | } 7 | \arguments{ 8 | \item{parser_output}{text that has been parsed} 9 | } 10 | \value{ 11 | data.frame containing the name, count and link of each 12 | function within the text 13 | } 14 | \description{ 15 | Find functions, counts, and links of given R text. 16 | } 17 | \author{ 18 | Barret Schloerke 19 | } 20 | \keyword{internal} 21 | 22 | -------------------------------------------------------------------------------- /man/dataframe_has_rows.Rd: -------------------------------------------------------------------------------- 1 | \name{dataframe_has_rows} 2 | \alias{dataframe_has_rows} 3 | \title{Determines whether or not the dataframe has rows.} 4 | \usage{ 5 | dataframe_has_rows(x) 6 | } 7 | \arguments{ 8 | \item{x}{item in question} 9 | } 10 | \description{ 11 | Determines whether or not the dataframe has rows. 12 | } 13 | \author{ 14 | Barret Schloerke 15 | } 16 | \keyword{internal} 17 | 18 | -------------------------------------------------------------------------------- /man/demo_info.Rd: -------------------------------------------------------------------------------- 1 | \name{demo_info} 2 | \alias{demo_info} 3 | \title{Demo information.} 4 | \usage{ 5 | demo_info(package, demo_name) 6 | } 7 | \arguments{ 8 | \item{package}{package name} 9 | 10 | \item{demo_name}{demo name} 11 | } 12 | \value{ 13 | demo() information for the \code{demo_name} in 14 | \code{package} 15 | } 16 | \description{ 17 | Demo information. 18 | } 19 | \author{ 20 | Barret Schloerke 21 | } 22 | \keyword{internal} 23 | 24 | -------------------------------------------------------------------------------- /man/demo_src.Rd: -------------------------------------------------------------------------------- 1 | \name{demo_src} 2 | \alias{demo_src} 3 | \title{Demo source.} 4 | \usage{ 5 | demo_src(package, demo_name) 6 | } 7 | \arguments{ 8 | \item{package}{package name} 9 | 10 | \item{demo_name}{demo name} 11 | } 12 | \value{ 13 | source for the demo 14 | } 15 | \description{ 16 | Demo source. 17 | } 18 | \author{ 19 | Barret Schloerke 20 | } 21 | \keyword{internal} 22 | 23 | -------------------------------------------------------------------------------- /man/demo_src_file.Rd: -------------------------------------------------------------------------------- 1 | \name{demo_src_file} 2 | \alias{demo_src_file} 3 | \title{Demo source file.} 4 | \usage{ 5 | demo_src_file(package, demo_name) 6 | } 7 | \arguments{ 8 | \item{package}{package name} 9 | 10 | \item{demo_name}{demo name} 11 | } 12 | \value{ 13 | "" if the demo is not found for that package, file.path 14 | if the demo folder is found 15 | } 16 | \description{ 17 | Demo source file. 18 | } 19 | \author{ 20 | Barret Schloerke 21 | } 22 | \keyword{internal} 23 | 24 | -------------------------------------------------------------------------------- /man/eval_on_global.Rd: -------------------------------------------------------------------------------- 1 | \name{eval_on_global} 2 | \alias{eval_on_global} 3 | \title{Eval text using the global environment. 4 | Using memoise to speedup reproducability.} 5 | \usage{ 6 | eval_on_global(...) 7 | } 8 | \arguments{ 9 | \item{txt}{text to be evaluated} 10 | } 11 | \description{ 12 | Eval text using the global environment. Using memoise to 13 | speedup reproducability. 14 | } 15 | \author{ 16 | Barret Schloerke 17 | } 18 | \keyword{evaluate} 19 | \keyword{importFrom} 20 | \keyword{internal} 21 | 22 | -------------------------------------------------------------------------------- /man/eval_tag_output.Rd: -------------------------------------------------------------------------------- 1 | \name{eval_tag_output} 2 | \alias{eval_tag_output} 3 | \title{Tag the output text with correct css class} 4 | \usage{ 5 | eval_tag_output(x) 6 | } 7 | \description{ 8 | Tag the output text with correct css class 9 | } 10 | \author{ 11 | Barret Schloerke 12 | } 13 | \keyword{internal} 14 | 15 | -------------------------------------------------------------------------------- /man/evaluate_text.Rd: -------------------------------------------------------------------------------- 1 | \name{evaluate_text} 2 | \alias{evaluate_text} 3 | \title{Evaluate text and return the corresponding text output and source.} 4 | \usage{ 5 | evaluate_text(txt, pic_base_name) 6 | } 7 | \arguments{ 8 | \item{txt}{text to be evaluated} 9 | 10 | \item{pic_base_name}{base name for the picture files} 11 | } 12 | \description{ 13 | Evaluate text and return the corresponding text output 14 | and source. 15 | } 16 | \author{ 17 | Barret Schloerke 18 | } 19 | \keyword{internal} 20 | 21 | -------------------------------------------------------------------------------- /man/exec_pkg_demo.Rd: -------------------------------------------------------------------------------- 1 | \name{exec_pkg_demo} 2 | \alias{exec_pkg_demo} 3 | \title{Evaluate demo in the R console.} 4 | \usage{ 5 | exec_pkg_demo(package, dem) 6 | } 7 | \arguments{ 8 | \item{package}{package in question} 9 | 10 | \item{dem}{demo in question} 11 | } 12 | \description{ 13 | Evaluate demo in the R console. 14 | } 15 | \author{ 16 | Barret Schloerke 17 | } 18 | \keyword{internal} 19 | 20 | -------------------------------------------------------------------------------- /man/first_item_pos.Rd: -------------------------------------------------------------------------------- 1 | \name{first_item_pos} 2 | \alias{first_item_pos} 3 | \title{Find the first item position.} 4 | \usage{ 5 | first_item_pos(arr) 6 | } 7 | \arguments{ 8 | \item{arr}{arr of items to look at} 9 | } 10 | \value{ 11 | position of the first item to match "\\item" else 1 12 | } 13 | \description{ 14 | Find the first item position. 15 | } 16 | \author{ 17 | Barret Schloerke 18 | } 19 | \keyword{internal} 20 | 21 | -------------------------------------------------------------------------------- /man/function_and_link.Rd: -------------------------------------------------------------------------------- 1 | \name{function_and_link} 2 | \alias{function_and_link} 3 | \title{Return the package functions and links of a given text.} 4 | \usage{ 5 | function_and_link(parser_output) 6 | } 7 | \arguments{ 8 | \item{parser_output}{text that has been parsed} 9 | } 10 | \description{ 11 | Return the package functions and links of a given text. 12 | } 13 | \author{ 14 | Barret Schloerke 15 | } 16 | \keyword{internal} 17 | 18 | -------------------------------------------------------------------------------- /man/function_help_path.Rd: -------------------------------------------------------------------------------- 1 | \name{function_help_path} 2 | \alias{function_help_path} 3 | \alias{function_help_path_mem} 4 | \title{Return the help path of a function.} 5 | \usage{ 6 | function_help_path(func, source_link = FALSE) 7 | } 8 | \arguments{ 9 | \item{x}{item to find the help path} 10 | 11 | \item{source_link}{boolean to determine whether or not it 12 | is linking to the source or topic page} 13 | } 14 | \description{ 15 | Return the help path of a function. 16 | } 17 | \author{ 18 | Barret Schloerke 19 | } 20 | \keyword{internal} 21 | 22 | -------------------------------------------------------------------------------- /man/function_levels.Rd: -------------------------------------------------------------------------------- 1 | \name{function_levels} 2 | \alias{function_levels} 3 | \title{Function levels. 4 | go through the function text to find the function level (depth) of each function} 5 | \usage{ 6 | function_levels(text) 7 | } 8 | \arguments{ 9 | \item{text}{text to be evaluated} 10 | } 11 | \description{ 12 | Function levels. go through the function text to find the 13 | function level (depth) of each function 14 | } 15 | \author{ 16 | Barret Schloerke 17 | } 18 | \keyword{internal} 19 | 20 | -------------------------------------------------------------------------------- /man/function_news.Rd: -------------------------------------------------------------------------------- 1 | \name{function_news} 2 | \alias{function_news} 3 | \title{Function news.} 4 | \usage{ 5 | function_news(package, topic) 6 | } 7 | \arguments{ 8 | \item{package}{package name} 9 | 10 | \item{topic}{demo name} 11 | } 12 | \description{ 13 | Function news. 14 | } 15 | \author{ 16 | Barret Schloerke 17 | } 18 | \keyword{internal} 19 | 20 | -------------------------------------------------------------------------------- /man/functions_used.Rd: -------------------------------------------------------------------------------- 1 | \name{functions_used} 2 | \alias{functions_used} 3 | \title{Functions used in the string of functions.} 4 | \usage{ 5 | functions_used(txt) 6 | } 7 | \arguments{ 8 | \item{txt}{text in question. should be full of 9 | functions} 10 | } 11 | \description{ 12 | Functions used in the string of functions. 13 | } 14 | \author{ 15 | Barret Schloerke 16 | } 17 | \keyword{internal} 18 | 19 | -------------------------------------------------------------------------------- /man/get_function_history.Rd: -------------------------------------------------------------------------------- 1 | \name{get_function_history} 2 | \alias{get_function_history} 3 | \title{List all recently called functions.} 4 | \value{ 5 | fuctions that are from a package 6 | } 7 | \description{ 8 | List all recently called functions. 9 | } 10 | \author{ 11 | Barret Schloerke 12 | } 13 | \keyword{internal} 14 | 15 | -------------------------------------------------------------------------------- /man/get_manuals.Rd: -------------------------------------------------------------------------------- 1 | \name{get_manuals} 2 | \alias{get_manuals} 3 | \title{Locate all R manuals on the local computer.} 4 | \usage{ 5 | get_manuals(...) 6 | } 7 | \description{ 8 | Locate all R manuals on the local computer. 9 | } 10 | \author{ 11 | Barret Schloerke 12 | } 13 | \keyword{internal} 14 | 15 | -------------------------------------------------------------------------------- /man/get_servr_query_result.Rd: -------------------------------------------------------------------------------- 1 | \name{get_servr_query_result} 2 | \alias{get_servr_query_result} 3 | \title{Solr query. 4 | Retrieve a solr query} 5 | \usage{ 6 | get_servr_query_result(query_list, function_field = 7 | FALSE) 8 | } 9 | \arguments{ 10 | \item{query_list}{list that contains the start position, 11 | query, and other parameters that are ready to be pasted} 12 | } 13 | \description{ 14 | Solr query. Retrieve a solr query 15 | } 16 | \author{ 17 | Barret Schloerke 18 | } 19 | \keyword{internal} 20 | 21 | -------------------------------------------------------------------------------- /man/get_solr_query_result.Rd: -------------------------------------------------------------------------------- 1 | \name{get_solr_query_result} 2 | \alias{get_solr_query_result} 3 | \title{Solr query. 4 | Retrieve a solr query} 5 | \usage{ 6 | get_solr_query_result(query_list, function_field = FALSE) 7 | } 8 | \arguments{ 9 | \item{query_list}{list that contains the start position, 10 | query, and other parameters that are ready to be pasted} 11 | } 12 | \description{ 13 | Solr query. Retrieve a solr query 14 | } 15 | \author{ 16 | Barret Schloerke 17 | } 18 | \keyword{internal} 19 | 20 | -------------------------------------------------------------------------------- /man/group_int_arr.Rd: -------------------------------------------------------------------------------- 1 | \name{group_int_arr} 2 | \alias{group_int_arr} 3 | \title{Group items into similar sections.} 4 | \usage{ 5 | group_int_arr(arr) 6 | } 7 | \description{ 8 | Group items into similar sections. 9 | } 10 | \author{ 11 | Barret Schloerke 12 | } 13 | \keyword{internal} 14 | 15 | -------------------------------------------------------------------------------- /man/has_text.Rd: -------------------------------------------------------------------------------- 1 | \name{has_text} 2 | \alias{has_text} 3 | \title{Determines whether or not the item has text.} 4 | \usage{ 5 | has_text(x) 6 | } 7 | \arguments{ 8 | \item{x}{item in question} 9 | } 10 | \description{ 11 | Determines whether or not the item has text. 12 | } 13 | \author{ 14 | Barret Schloerke 15 | } 16 | \keyword{internal} 17 | 18 | -------------------------------------------------------------------------------- /man/helpr.Rd: -------------------------------------------------------------------------------- 1 | \name{helpr} 2 | \alias{helpr} 3 | \title{Start helpr.} 4 | \usage{ 5 | helpr(launch_browser = TRUE, no_internetz = NULL, custom 6 | = NULL) 7 | } 8 | \arguments{ 9 | \item{launch_browser}{should this function launch a 10 | browser for immediate viewing of help pages?} 11 | 12 | \item{no_internetz}{should this function allow the 13 | browser to source internet files and actions? Default is 14 | to allow internet connections} 15 | 16 | \item{custom}{should this function launch in the custom 17 | httpd handlers env? Default is to be at the root of ""} 18 | } 19 | \description{ 20 | Start helpr. 21 | } 22 | \author{ 23 | Barret Schloerke and Hadley Wickham 24 | } 25 | 26 | -------------------------------------------------------------------------------- /man/helpr_demo.Rd: -------------------------------------------------------------------------------- 1 | \name{helpr_demo} 2 | \alias{helpr_demo} 3 | \title{helpr demo information.} 4 | \usage{ 5 | helpr_demo(package, demo_name) 6 | } 7 | \arguments{ 8 | \item{package}{package name} 9 | 10 | \item{demo_name}{demo name} 11 | } 12 | \description{ 13 | helpr demo information. 14 | } 15 | \keyword{internal} 16 | 17 | -------------------------------------------------------------------------------- /man/helpr_function.Rd: -------------------------------------------------------------------------------- 1 | \name{helpr_function} 2 | \alias{helpr_function} 3 | \title{Render all the information to display a topic source page.} 4 | \usage{ 5 | helpr_function(package, func) 6 | } 7 | \arguments{ 8 | \item{package}{package in question} 9 | 10 | \item{func}{function in question} 11 | } 12 | \description{ 13 | Render all the information to display a topic source 14 | page. 15 | } 16 | \author{ 17 | Barret Schloerke 18 | } 19 | \keyword{internal} 20 | 21 | -------------------------------------------------------------------------------- /man/helpr_home.Rd: -------------------------------------------------------------------------------- 1 | \name{helpr_home} 2 | \alias{helpr_home} 3 | \title{Helpr Home.} 4 | \value{ 5 | all the information necessary to produce the home site 6 | ("index.html") 7 | } 8 | \description{ 9 | Helpr Home. 10 | } 11 | \author{ 12 | Hadley Wickham and Barret Schloerke 13 | } 14 | \keyword{internal} 15 | 16 | -------------------------------------------------------------------------------- /man/helpr_package.Rd: -------------------------------------------------------------------------------- 1 | \name{helpr_package} 2 | \alias{helpr_package} 3 | \alias{helpr_package_mem} 4 | \title{Package information.} 5 | \usage{ 6 | helpr_package(package) 7 | } 8 | \value{ 9 | all the information necessary to produce a package site 10 | ("/package/:package/") 11 | } 12 | \description{ 13 | Package information. 14 | } 15 | \author{ 16 | Barret Schloerke 17 | } 18 | \keyword{internal} 19 | 20 | -------------------------------------------------------------------------------- /man/helpr_path.Rd: -------------------------------------------------------------------------------- 1 | \name{helpr_path} 2 | \alias{helpr_path} 3 | \title{Helpr Path: Where's my help at?} 4 | \usage{ 5 | helpr_path(...) 6 | } 7 | \value{ 8 | returns the path the to the helpr dir. This could be 9 | local or the system (installed) path 10 | } 11 | \description{ 12 | Helpr Path: Where's my help at? 13 | } 14 | \examples{ 15 | #if(identical(helpr_path(), getwd())) { 16 | # "you are a developer" 17 | #} else { 18 | # "you have installed helpr" 19 | #} 20 | } 21 | \keyword{internal} 22 | 23 | -------------------------------------------------------------------------------- /man/helpr_render_json.Rd: -------------------------------------------------------------------------------- 1 | \name{helpr_render_json} 2 | \alias{helpr_render_json} 3 | \title{Render JSON} 4 | \usage{ 5 | helpr_render_json(obj) 6 | } 7 | \arguments{ 8 | \item{obj}{object to be rendered} 9 | } 10 | \description{ 11 | Remove the warnings from the rendering of the JSON 12 | } 13 | \author{ 14 | Barret Schloerke 15 | } 16 | \keyword{internal} 17 | 18 | -------------------------------------------------------------------------------- /man/helpr_replay.Rd: -------------------------------------------------------------------------------- 1 | \name{helpr_replay} 2 | \alias{helpr_replay} 3 | \title{Replay a list of evaluated results, just like you'd run them in a R 4 | terminal.} 5 | \usage{ 6 | helpr_replay(x, pic_base_name) 7 | } 8 | \arguments{ 9 | \item{x}{result from \code{\link{evaluate}}} 10 | 11 | \item{pic_base_name}{base picture name to be used} 12 | } 13 | \description{ 14 | Replay a list of evaluated results, just like you'd run 15 | them in a R terminal. 16 | } 17 | \author{ 18 | Barret Schloerke 19 | } 20 | \keyword{internal} 21 | 22 | -------------------------------------------------------------------------------- /man/helpr_solr_search.Rd: -------------------------------------------------------------------------------- 1 | \name{helpr_solr_search} 2 | \alias{helpr_solr_search} 3 | \title{Helpr Search.} 4 | \usage{ 5 | helpr_solr_search(query_list) 6 | } 7 | \arguments{ 8 | \item{query_list}{list that contains the start position, 9 | query, and other parameters} 10 | } 11 | \value{ 12 | returns all the necessary information from a search 13 | } 14 | \description{ 15 | Helpr Search. 16 | } 17 | \author{ 18 | Barret Schloerke 19 | } 20 | \keyword{internal} 21 | 22 | -------------------------------------------------------------------------------- /man/helpr_topic.Rd: -------------------------------------------------------------------------------- 1 | \name{helpr_topic} 2 | \alias{helpr_topic} 3 | \title{Helpr home.} 4 | \usage{ 5 | helpr_topic(package, topic, highlight) 6 | } 7 | \value{ 8 | all the information necessary to produce the home site 9 | ("index.html") 10 | } 11 | \description{ 12 | Helpr home. 13 | } 14 | \author{ 15 | Barret Schloerke 16 | } 17 | \keyword{internal} 18 | 19 | -------------------------------------------------------------------------------- /man/highlight.Rd: -------------------------------------------------------------------------------- 1 | \name{highlight} 2 | \alias{highlight} 3 | \title{Highlight R text. 4 | Highlights R text to include links to all functions and make it easier to read} 5 | \usage{ 6 | highlight(parser_output, source_link = FALSE) 7 | } 8 | \arguments{ 9 | \item{parser_output}{text to be parsed and highlighted} 10 | } 11 | \value{ 12 | highlighted text 13 | } 14 | \description{ 15 | Highlight R text. Highlights R text to include links to 16 | all functions and make it easier to read 17 | } 18 | \author{ 19 | Hadley Wickham and Barret Schloerke 20 | } 21 | \keyword{internal} 22 | 23 | -------------------------------------------------------------------------------- /man/i_can_has_internetz.Rd: -------------------------------------------------------------------------------- 1 | \name{i_can_has_internetz} 2 | \alias{i_can_has_internetz} 3 | \title{Check to see if solr is running. 4 | A check to see if solr is running called and memoised at the start of \code{helpr()}} 5 | \usage{ 6 | i_can_has_internetz(...) 7 | } 8 | \arguments{ 9 | \item{...}{ignored} 10 | } 11 | \description{ 12 | Check to see if solr is running. A check to see if solr 13 | is running called and memoised at the start of 14 | \code{helpr()} 15 | } 16 | \author{ 17 | Barret Schloerke 18 | } 19 | 20 | -------------------------------------------------------------------------------- /man/index_all.Rd: -------------------------------------------------------------------------------- 1 | \name{index_all} 2 | \alias{index_all} 3 | \alias{index_packages} 4 | \title{Index all packages. 5 | Index all packages into solr} 6 | \usage{ 7 | index_all(start_letter = "a", verbose = TRUE) 8 | } 9 | \arguments{ 10 | \item{start_letter}{used when you want to start froma 11 | certain letter, such as 'q'} 12 | 13 | \item{verbose}{should output be shown?} 14 | } 15 | \description{ 16 | Index all packages. Index all packages into solr 17 | } 18 | \author{ 19 | Barret Schloerke 20 | } 21 | 22 | -------------------------------------------------------------------------------- /man/index_package.Rd: -------------------------------------------------------------------------------- 1 | \name{index_package} 2 | \alias{index_package} 3 | \title{Index package. 4 | Index a whole package into solr} 5 | \usage{ 6 | index_package(package, start_letter = "a", verbose = 7 | TRUE) 8 | } 9 | \arguments{ 10 | \item{package}{package in question} 11 | 12 | \item{start_letter}{used when you want to start froma 13 | certain letter, such as 'q'} 14 | 15 | \item{verbose}{should output be shown?} 16 | } 17 | \description{ 18 | Index package. Index a whole package into solr 19 | } 20 | \author{ 21 | Barret Schloerke 22 | } 23 | 24 | -------------------------------------------------------------------------------- /man/index_topic.Rd: -------------------------------------------------------------------------------- 1 | \name{index_topic} 2 | \alias{index_topic} 3 | \title{Index topic. 4 | Index a topic into solr} 5 | \usage{ 6 | index_topic(package, topic) 7 | } 8 | \arguments{ 9 | \item{package}{package in question} 10 | 11 | \item{topic}{topic in question} 12 | } 13 | \description{ 14 | Index topic. Index a topic into solr 15 | } 16 | \author{ 17 | Barret Schloerke 18 | } 19 | 20 | -------------------------------------------------------------------------------- /man/install_packages.Rd: -------------------------------------------------------------------------------- 1 | \name{install_packages} 2 | \alias{install_packages} 3 | \title{Install packages. 4 | update a vector of packages} 5 | \usage{ 6 | install_packages(pkg_vec) 7 | } 8 | \description{ 9 | Install packages. update a vector of packages 10 | } 11 | \author{ 12 | Barret Schloerke 13 | } 14 | \keyword{internal} 15 | 16 | -------------------------------------------------------------------------------- /man/installed_packages.Rd: -------------------------------------------------------------------------------- 1 | \name{installed_packages} 2 | \alias{installed_packages} 3 | \title{Installed packages.} 4 | \value{ 5 | a list of packages 6 | } 7 | \description{ 8 | Runs about 10x faster than 9 | \code{\link{installed.packages}} 10 | } 11 | \author{ 12 | Hadley Wickham 13 | } 14 | \keyword{internal} 15 | 16 | -------------------------------------------------------------------------------- /man/is_section.Rd: -------------------------------------------------------------------------------- 1 | \name{is_section} 2 | \alias{is_section} 3 | \title{Determines whether or not tag is a section} 4 | \usage{ 5 | is_section(tag) 6 | } 7 | \arguments{ 8 | \item{tag}{check to see if the tag is in a list of other 9 | tags} 10 | } 11 | \description{ 12 | Determines whether or not tag is a section 13 | } 14 | \author{ 15 | Hadley Wickham 16 | } 17 | \keyword{internal} 18 | 19 | -------------------------------------------------------------------------------- /man/last_item_pos.Rd: -------------------------------------------------------------------------------- 1 | \name{last_item_pos} 2 | \alias{last_item_pos} 3 | \title{Find the last Item position.} 4 | \usage{ 5 | last_item_pos(arr) 6 | } 7 | \arguments{ 8 | \item{arr}{arr of items to look at} 9 | } 10 | \value{ 11 | position of the last item to match "\\item" else 0 12 | } 13 | \description{ 14 | Find the last Item position. 15 | } 16 | \author{ 17 | Barret Schloerke 18 | } 19 | \keyword{internal} 20 | 21 | -------------------------------------------------------------------------------- /man/last_ten_functions.Rd: -------------------------------------------------------------------------------- 1 | \name{last_ten_functions} 2 | \alias{last_ten_functions} 3 | \title{List last ten unique functions called from the command line.} 4 | \usage{ 5 | last_ten_functions(fun_list = get_function_history()) 6 | } 7 | \arguments{ 8 | \item{fun_list}{function list} 9 | } 10 | \value{ 11 | fuctions that are from a package and their help paths 12 | } 13 | \description{ 14 | List last ten unique functions called from the command 15 | line. 16 | } 17 | \author{ 18 | Barret Schloerke 19 | } 20 | \keyword{internal} 21 | 22 | -------------------------------------------------------------------------------- /man/list_tags.Rd: -------------------------------------------------------------------------------- 1 | \name{list_tags} 2 | \alias{list_tags} 3 | \title{List tags 4 | list all the tags within a object} 5 | \usage{ 6 | list_tags(rd) 7 | } 8 | \arguments{ 9 | \item{rd}{rd in question} 10 | } 11 | \description{ 12 | List tags list all the tags within a object 13 | } 14 | \author{ 15 | Barret Schloerke 16 | } 17 | \keyword{internal} 18 | 19 | -------------------------------------------------------------------------------- /man/list_to_double_list.Rd: -------------------------------------------------------------------------------- 1 | \name{list_to_double_list} 2 | \alias{list_to_double_list} 3 | \title{Make a list into a nested list. 4 | this is to be done to easily use sapply and keep the name of the item} 5 | \usage{ 6 | list_to_double_list(obj) 7 | } 8 | \arguments{ 9 | \item{obj}{list to perform on} 10 | } 11 | \description{ 12 | Make a list into a nested list. this is to be done to 13 | easily use sapply and keep the name of the item 14 | } 15 | \author{ 16 | Barret Schloerke 17 | } 18 | \keyword{internal} 19 | 20 | -------------------------------------------------------------------------------- /man/list_to_xml.Rd: -------------------------------------------------------------------------------- 1 | \name{list_to_xml} 2 | \alias{list_to_xml} 3 | \title{Turn a list into a solr doc. 4 | turn a list into a solr doc} 5 | \usage{ 6 | list_to_xml(id, obj) 7 | } 8 | \arguments{ 9 | \item{id}{id tag to be used} 10 | 11 | \item{obj}{list to perform on} 12 | } 13 | \description{ 14 | Turn a list into a solr doc. turn a list into a solr doc 15 | } 16 | \author{ 17 | Barret Schloerke 18 | } 19 | \keyword{internal} 20 | 21 | -------------------------------------------------------------------------------- /man/load_html.Rd: -------------------------------------------------------------------------------- 1 | \name{load_html} 2 | \alias{load_html} 3 | \title{Load an html page from the console.} 4 | \usage{ 5 | load_html(..., character.only = FALSE) 6 | } 7 | \arguments{ 8 | \item{...}{site to be loaded} 9 | 10 | \item{character.only}{flag to substitute or not} 11 | } 12 | \description{ 13 | Load an html page from the console. 14 | } 15 | \author{ 16 | Barret Schloerke 17 | } 18 | 19 | -------------------------------------------------------------------------------- /man/local_mode.Rd: -------------------------------------------------------------------------------- 1 | \name{local_mode} 2 | \alias{activate_internetz} 3 | \alias{allow_internetz} 4 | \alias{deactivate_internetz} 5 | \alias{local_mode} 6 | \title{Local Mode} 7 | \description{ 8 | Local Mode 9 | } 10 | \author{ 11 | Barret Schloerke 12 | } 13 | \keyword{internal} 14 | 15 | -------------------------------------------------------------------------------- /man/make_add_xml.Rd: -------------------------------------------------------------------------------- 1 | \name{make_add_xml} 2 | \alias{make_add_xml} 3 | \title{Make it so the xml is an 'add'. 4 | make it so the xml is an 'add' to be commited to solr} 5 | \usage{ 6 | make_add_xml(obj) 7 | } 8 | \arguments{ 9 | \item{obj}{list to perform on} 10 | } 11 | \description{ 12 | Make it so the xml is an 'add'. make it so the xml is an 13 | 'add' to be commited to solr 14 | } 15 | \author{ 16 | Barret Schloerke 17 | } 18 | \keyword{internal} 19 | 20 | -------------------------------------------------------------------------------- /man/make_field.Rd: -------------------------------------------------------------------------------- 1 | \name{make_field} 2 | \alias{make_field} 3 | \title{Make a xml field. 4 | make a field for a solr document} 5 | \usage{ 6 | make_field(name, value) 7 | } 8 | \arguments{ 9 | \item{name}{name of the field} 10 | 11 | \item{value}{value of the field} 12 | } 13 | \description{ 14 | Make a xml field. make a field for a solr document 15 | } 16 | \author{ 17 | Barret Schloerke 18 | } 19 | \keyword{internal} 20 | 21 | -------------------------------------------------------------------------------- /man/name_rd.Rd: -------------------------------------------------------------------------------- 1 | \name{name_rd} 2 | \alias{name_rd} 3 | \title{Name R documentation.} 4 | \usage{ 5 | name_rd(rd) 6 | } 7 | \arguments{ 8 | \item{rd}{rd file to use} 9 | } 10 | \value{ 11 | rd file properly named according to the tags 12 | } 13 | \description{ 14 | Name R documentation. 15 | } 16 | \author{ 17 | Hadley Wickham 18 | } 19 | \keyword{internal} 20 | 21 | -------------------------------------------------------------------------------- /man/old_package_names.Rd: -------------------------------------------------------------------------------- 1 | \name{old_package_names} 2 | \alias{old_package_names} 3 | \title{Out of date packages.} 4 | \description{ 5 | Out of date packages. 6 | } 7 | \author{ 8 | Barret Schloerke 9 | } 10 | \keyword{internal} 11 | 12 | -------------------------------------------------------------------------------- /man/package_and_topic_from_url.Rd: -------------------------------------------------------------------------------- 1 | \name{package_and_topic_from_url} 2 | \alias{package_and_topic_from_url} 3 | \title{Pkg and topic from URL. 4 | Retrieve the pkg and topic from the URL} 5 | \usage{ 6 | package_and_topic_from_url(url_txt) 7 | } 8 | \arguments{ 9 | \item{url_txt}{url to be parsed} 10 | } 11 | \description{ 12 | Pkg and topic from URL. Retrieve the pkg and topic from 13 | the URL 14 | } 15 | \author{ 16 | Barret Schloerke 17 | } 18 | \keyword{internal} 19 | 20 | -------------------------------------------------------------------------------- /man/package_description.Rd: -------------------------------------------------------------------------------- 1 | \name{package_description} 2 | \alias{package_description} 3 | \title{Package description} 4 | \usage{ 5 | package_description(pkg, topic) 6 | } 7 | \arguments{ 8 | \item{pkg}{package in question} 9 | 10 | \item{topic}{topic in question} 11 | } 12 | \description{ 13 | Package description 14 | } 15 | \author{ 16 | Barret Schloerke 17 | } 18 | \keyword{internal} 19 | 20 | -------------------------------------------------------------------------------- /man/parse_help.Rd: -------------------------------------------------------------------------------- 1 | \name{parse_help} 2 | \alias{parse_help} 3 | \title{Parse help file. 4 | Function to turn a help topic into a convenient format.} 5 | \usage{ 6 | parse_help(rd, package) 7 | } 8 | \arguments{ 9 | \item{rd}{item to be tagged recursively} 10 | } 11 | \value{ 12 | item reformatted to be used in HTML 13 | } 14 | \description{ 15 | Parse help file. Function to turn a help topic into a 16 | convenient format. 17 | } 18 | \author{ 19 | Hadley Wickham and Barret Schloerke 20 | } 21 | \keyword{internal} 22 | 23 | -------------------------------------------------------------------------------- /man/parse_item_list.Rd: -------------------------------------------------------------------------------- 1 | \name{parse_item_list} 2 | \alias{parse_item_list} 3 | \title{Parse a group of "\\item" into a table with a bold item and reconstructed 4 | description.} 5 | \usage{ 6 | parse_item_list(rd, package) 7 | } 8 | \arguments{ 9 | \item{rd}{item to be parsed} 10 | 11 | \item{package}{package looking at} 12 | } 13 | \value{ 14 | table text with no attributes 15 | } 16 | \description{ 17 | Parse a group of "\\item" into a table with a bold item 18 | and reconstructed description. 19 | } 20 | \author{ 21 | Barret Schloerke 22 | } 23 | \keyword{internal} 24 | 25 | -------------------------------------------------------------------------------- /man/parse_items.Rd: -------------------------------------------------------------------------------- 1 | \name{parse_items} 2 | \alias{parse_items} 3 | \title{Parse a list containing "\\item" tags.} 4 | \usage{ 5 | parse_items(rd, package) 6 | } 7 | \arguments{ 8 | \item{rd}{R documentation item to be altered and then 9 | returned} 10 | 11 | \item{package}{package looking at} 12 | } 13 | \description{ 14 | It will replace the items with plan, non-attributed text. 15 | It needs to be a 'pre-parser' as it must be done before 16 | the whole list is reconstructed 17 | } 18 | \author{ 19 | Barret Schloerke 20 | } 21 | \keyword{internal} 22 | 23 | -------------------------------------------------------------------------------- /man/parse_pkg_desc_item.Rd: -------------------------------------------------------------------------------- 1 | \name{parse_pkg_desc_item} 2 | \alias{parse_pkg_desc_item} 3 | \title{Ensure package version is properly displayed (if not already in a nice 4 | format).} 5 | \usage{ 6 | parse_pkg_desc_item(obj) 7 | } 8 | \description{ 9 | Ensure package version is properly displayed (if not 10 | already in a nice format). 11 | } 12 | \author{ 13 | Barret Schloerke 14 | } 15 | \keyword{internal} 16 | 17 | -------------------------------------------------------------------------------- /man/parse_tabular.Rd: -------------------------------------------------------------------------------- 1 | \name{parse_tabular} 2 | \alias{parse_tabular} 3 | \title{Parse a Tabular Section 4 | Parse a tabular section to include the text alignments} 5 | \usage{ 6 | parse_tabular(tabular) 7 | } 8 | \arguments{ 9 | \item{tabular}{rd item to parsed} 10 | } 11 | \description{ 12 | Parse a Tabular Section Parse a tabular section to 13 | include the text alignments 14 | } 15 | \author{ 16 | Barret Schloerke 17 | } 18 | \keyword{internal} 19 | 20 | -------------------------------------------------------------------------------- /man/parse_text.Rd: -------------------------------------------------------------------------------- 1 | \name{parse_text} 2 | \alias{parse_text} 3 | \title{Parse Text 4 | wrapper to parser's \code{parser(text = text)}} 5 | \usage{ 6 | parse_text(text) 7 | } 8 | \arguments{ 9 | \item{text}{text to be parsed} 10 | } 11 | \description{ 12 | Parse Text wrapper to parser's \code{parser(text = text)} 13 | } 14 | \author{ 15 | Barret Schloerke 16 | } 17 | \keyword{internal} 18 | 19 | -------------------------------------------------------------------------------- /man/parse_usage.Rd: -------------------------------------------------------------------------------- 1 | \name{parse_usage} 2 | \alias{parse_usage} 3 | \title{Parse usage. 4 | Parse the topic usage to add links to functions} 5 | \usage{ 6 | parse_usage(usage, package) 7 | } 8 | \arguments{ 9 | \item{usage}{rd usage} 10 | } 11 | \description{ 12 | Parse usage. Parse the topic usage to add links to 13 | functions 14 | } 15 | \author{ 16 | Barret Schloerke 17 | } 18 | \keyword{internal} 19 | 20 | -------------------------------------------------------------------------------- /man/pkg_and_topic_from_help_url.Rd: -------------------------------------------------------------------------------- 1 | \name{pkg_and_topic_from_help_url} 2 | \alias{pkg_and_topic_from_help_url} 3 | \title{Retrieve the package and the topic from a url that contains both.} 4 | \usage{ 5 | pkg_and_topic_from_help_url(url_string) 6 | } 7 | \arguments{ 8 | \item{url_string}{url in question} 9 | } 10 | \description{ 11 | Retrieve the package and the topic from a url that 12 | contains both. 13 | } 14 | \author{ 15 | Barret Schloerke 16 | } 17 | \keyword{internal} 18 | 19 | -------------------------------------------------------------------------------- /man/pkg_author_and_maintainers.Rd: -------------------------------------------------------------------------------- 1 | \name{pkg_author_and_maintainers} 2 | \alias{pkg_author_and_maintainers} 3 | \title{Parse authors and maintainer.} 4 | \usage{ 5 | pkg_author_and_maintainers(authors, maintainer = NULL) 6 | } 7 | \arguments{ 8 | \item{description}{list containing the \code{author} and 9 | \code{maintainer}} 10 | } 11 | \value{ 12 | string containing the authors with links properly 13 | displayed 14 | } 15 | \description{ 16 | Parse authors and maintainer. 17 | } 18 | \author{ 19 | Barret Schloerke 20 | } 21 | \keyword{internal} 22 | 23 | -------------------------------------------------------------------------------- /man/pkg_demos.Rd: -------------------------------------------------------------------------------- 1 | \name{pkg_demos} 2 | \alias{pkg_demos} 3 | \title{List all demos in a package.} 4 | \usage{ 5 | pkg_demos(package) 6 | } 7 | \arguments{ 8 | \item{package}{package name} 9 | } 10 | \value{ 11 | demo() information for the \code{demo_name} in 12 | \code{package} 13 | } 14 | \description{ 15 | List all demos in a package. 16 | } 17 | \author{ 18 | Barret Schloerke 19 | } 20 | \keyword{internal} 21 | 22 | -------------------------------------------------------------------------------- /man/pkg_help_path.Rd: -------------------------------------------------------------------------------- 1 | \name{pkg_help_path} 2 | \alias{pkg_help_path} 3 | \title{Package help path.} 4 | \usage{ 5 | pkg_help_path(package) 6 | } 7 | \arguments{ 8 | \item{package}{package to explore} 9 | } 10 | \value{ 11 | \code{file.path} to the help folder 12 | } 13 | \description{ 14 | Package help path. 15 | } 16 | \author{ 17 | Hadley Wickham 18 | } 19 | \keyword{internal} 20 | 21 | -------------------------------------------------------------------------------- /man/pkg_news.Rd: -------------------------------------------------------------------------------- 1 | \name{pkg_news} 2 | \alias{pkg_news} 3 | \title{Package news.} 4 | \usage{ 5 | pkg_news(package) 6 | } 7 | \arguments{ 8 | \item{package}{package name} 9 | } 10 | \description{ 11 | Package news. 12 | } 13 | \author{ 14 | Barret Schloerke 15 | } 16 | \keyword{internal} 17 | 18 | -------------------------------------------------------------------------------- /man/pkg_rddb_path.Rd: -------------------------------------------------------------------------------- 1 | \name{pkg_rddb_path} 2 | \alias{pkg_rddb_path} 3 | \title{Documentation database path.} 4 | \usage{ 5 | pkg_rddb_path(package) 6 | } 7 | \arguments{ 8 | \item{package}{package to explore} 9 | } 10 | \value{ 11 | \code{file.path} to the documentation database 12 | } 13 | \description{ 14 | Documentation database path. 15 | } 16 | \author{ 17 | Hadley Wickham 18 | } 19 | \keyword{internal} 20 | 21 | -------------------------------------------------------------------------------- /man/pkg_topic.Rd: -------------------------------------------------------------------------------- 1 | \name{pkg_topic} 2 | \alias{pkg_topic} 3 | \title{Package topic R documentation.} 4 | \usage{ 5 | pkg_topic(package, topic, file = NULL) 6 | } 7 | \arguments{ 8 | \item{package}{package to explore} 9 | 10 | \item{topic}{topic of the package to retrieve} 11 | 12 | \item{file}{location of the rd database. If it is 13 | \code{NULL}, it will be found.} 14 | } 15 | \value{ 16 | text of the .rd file 17 | } 18 | \description{ 19 | Package topic R documentation. 20 | } 21 | \author{ 22 | Haldey Wickham and Barret Schloerke 23 | } 24 | \keyword{internal} 25 | 26 | -------------------------------------------------------------------------------- /man/pkg_topics_alias.Rd: -------------------------------------------------------------------------------- 1 | \name{pkg_topics_alias} 2 | \alias{pkg_topics_alias} 3 | \title{Topic title and aliases by package. 4 | return information on the package, datasets, internal, and datasets} 5 | \usage{ 6 | pkg_topics_alias(pkg) 7 | } 8 | \arguments{ 9 | \item{pkg}{package in question} 10 | } 11 | \description{ 12 | Topic title and aliases by package. return information on 13 | the package, datasets, internal, and datasets 14 | } 15 | \author{ 16 | Barret Schloerke 17 | } 18 | \keyword{internal} 19 | 20 | -------------------------------------------------------------------------------- /man/pkg_topics_index.Rd: -------------------------------------------------------------------------------- 1 | \name{pkg_topics_index} 2 | \alias{pkg_topics_index} 3 | \title{Package topics alias to file index.} 4 | \usage{ 5 | pkg_topics_index(...) 6 | } 7 | \arguments{ 8 | \item{package}{package to explore} 9 | } 10 | \value{ 11 | \code{\link{data.frame}} containing \code{alias} 12 | (function name) and \code{file} that it is associated 13 | with 14 | } 15 | \description{ 16 | Package topics alias to file index. 17 | } 18 | \author{ 19 | Hadley Wickham 20 | } 21 | \keyword{internal} 22 | 23 | -------------------------------------------------------------------------------- /man/pkg_topics_rd.Rd: -------------------------------------------------------------------------------- 1 | \name{pkg_topics_rd} 2 | \alias{pkg_topics_rd} 3 | \title{Package topics file documentation.} 4 | \usage{ 5 | pkg_topics_rd(...) 6 | } 7 | \arguments{ 8 | \item{package}{package to explore} 9 | } 10 | \value{ 11 | \code{\link{list}} containing the documentation file of 12 | each file of a package 13 | } 14 | \description{ 15 | Items can be accessed by 16 | \emph{\code{list()}}\code{$file_name} 17 | } 18 | \author{ 19 | Hadley Wickham 20 | } 21 | \keyword{internal} 22 | 23 | -------------------------------------------------------------------------------- /man/pkg_version.Rd: -------------------------------------------------------------------------------- 1 | \name{pkg_version} 2 | \alias{pkg_version} 3 | \title{Package version from the rd file} 4 | \usage{ 5 | pkg_version(pkg) 6 | } 7 | \description{ 8 | Package version from the rd file 9 | } 10 | \author{ 11 | Hadley Wickham 12 | } 13 | \keyword{internal} 14 | 15 | -------------------------------------------------------------------------------- /man/pkg_vigs.Rd: -------------------------------------------------------------------------------- 1 | \name{pkg_vigs} 2 | \alias{pkg_vigs} 3 | \title{List all package vignettes.} 4 | \usage{ 5 | pkg_vigs(package) 6 | } 7 | \arguments{ 8 | \item{package}{package to explore} 9 | } 10 | \value{ 11 | \code{subset} of the \code{vignette()$results} 12 | \code{data.frame} ("Package", "LibPath", "Item" and 13 | "Title") 14 | } 15 | \description{ 16 | List all package vignettes. 17 | } 18 | \author{ 19 | Barret Schloerke 20 | } 21 | \keyword{internal} 22 | 23 | -------------------------------------------------------------------------------- /man/pluralize.Rd: -------------------------------------------------------------------------------- 1 | \name{pluralize} 2 | \alias{pluralize} 3 | \title{Pluralize 4 | pluralize a string with either the default 's' according to the boolean statement} 5 | \usage{ 6 | pluralize(string, obj, plural = str_c(string, "s"), 7 | bool_statement = NROW(obj)) 8 | } 9 | \arguments{ 10 | \item{string}{string to be pluralized} 11 | 12 | \item{obj}{object to look at} 13 | 14 | \item{plural}{plural string} 15 | 16 | \item{bool_statement}{boolean to use to determine which 17 | string to use} 18 | } 19 | \description{ 20 | Pluralize pluralize a string with either the default 's' 21 | according to the boolean statement 22 | } 23 | \author{ 24 | Barret Schloerke 25 | } 26 | \keyword{internal} 27 | 28 | -------------------------------------------------------------------------------- /man/print.help_files_with_topic.Rd: -------------------------------------------------------------------------------- 1 | \name{print.help_files_with_topic} 2 | \alias{print.help_files_with_topic} 3 | \title{Route to the topics with multiple files to correct page.} 4 | \usage{ 5 | \method{print}{help_files_with_topic} (x, ...) 6 | } 7 | \arguments{ 8 | \item{x}{path to help} 9 | 10 | \item{...}{other arguments ignored} 11 | } 12 | \description{ 13 | Modified from \code{utils:::print.help_files_with_topic} 14 | } 15 | \author{ 16 | Barret Schloerke 17 | } 18 | 19 | -------------------------------------------------------------------------------- /man/print.packageInfo.Rd: -------------------------------------------------------------------------------- 1 | \name{print.packageInfo} 2 | \alias{print.packageInfo} 3 | \title{Route to the package page} 4 | \usage{ 5 | print.packageInfo(x, ...) 6 | } 7 | \arguments{ 8 | \item{x}{object supplied from help function describing a 9 | package} 10 | 11 | \item{...}{ignored} 12 | } 13 | \description{ 14 | Route to the package page 15 | } 16 | 17 | -------------------------------------------------------------------------------- /man/put_file.Rd: -------------------------------------------------------------------------------- 1 | \name{put_file} 2 | \alias{put_file} 3 | \title{PUT a file to the Solr server.} 4 | \usage{ 5 | put_file(file_name) 6 | } 7 | \description{ 8 | PUT a file to the Solr server. 9 | } 10 | \author{ 11 | Barret Schloerke 12 | } 13 | \keyword{internal} 14 | 15 | -------------------------------------------------------------------------------- /man/put_string.Rd: -------------------------------------------------------------------------------- 1 | \name{put_string} 2 | \alias{put_string} 3 | \title{PUT a string to the Solr server.} 4 | \usage{ 5 | put_string(string) 6 | } 7 | \description{ 8 | PUT a string to the Solr server. 9 | } 10 | \author{ 11 | Barret Schloerke 12 | } 13 | \keyword{internal} 14 | 15 | -------------------------------------------------------------------------------- /man/read_rds.Rd: -------------------------------------------------------------------------------- 1 | \name{read_rds} 2 | \alias{read_rds} 3 | \title{Read RDS file} 4 | \usage{ 5 | read_rds(...) 6 | } 7 | \arguments{ 8 | \item{...}{args sent directly to base's read rds 9 | function} 10 | } 11 | \description{ 12 | Read RDS file 13 | } 14 | \author{ 15 | Barret Schloerke 16 | } 17 | \keyword{internal} 18 | 19 | -------------------------------------------------------------------------------- /man/read_url.Rd: -------------------------------------------------------------------------------- 1 | \name{read_url} 2 | \alias{read_url} 3 | \title{Read URL. 4 | Retrieve the text from a URL} 5 | \usage{ 6 | read_url(url_string) 7 | } 8 | \arguments{ 9 | \item{url_string}{url to explore} 10 | } 11 | \value{ 12 | plain text from that url 13 | } 14 | \description{ 15 | Read URL. Retrieve the text from a URL 16 | } 17 | \author{ 18 | Barret Schloerke 19 | } 20 | \keyword{internal} 21 | 22 | -------------------------------------------------------------------------------- /man/reconstruct.Rd: -------------------------------------------------------------------------------- 1 | \name{reconstruct} 2 | \alias{reconstruct} 3 | \title{Recursively reconstruct R documentation.} 4 | \usage{ 5 | reconstruct(rd, package = NULL) 6 | } 7 | \arguments{ 8 | \item{rd}{rd in question} 9 | } 10 | \description{ 11 | Recursively reconstruct R documentation. 12 | } 13 | \author{ 14 | Hadley Wickham and Barret Schloerke 15 | } 16 | \keyword{internal} 17 | 18 | -------------------------------------------------------------------------------- /man/render_snippet.Rd: -------------------------------------------------------------------------------- 1 | \name{render_snippet} 2 | \alias{render_snippet} 3 | \title{Render HTML Snippet.} 4 | \usage{ 5 | render_snippet(template, params = NULL, path = 6 | router_file_path()) 7 | } 8 | \arguments{ 9 | \item{template}{name of file to use in the folder 10 | "views"} 11 | 12 | \item{params}{list containing objects to be sent to the 13 | template} 14 | 15 | \item{path}{path to be used to find the "views" folder} 16 | } 17 | \value{ 18 | text rendered from the template 19 | } 20 | \description{ 21 | Render HTML Snippet. 22 | } 23 | \author{ 24 | Barret Schloerke 25 | } 26 | \keyword{internal} 27 | 28 | -------------------------------------------------------------------------------- /man/rp.Rd: -------------------------------------------------------------------------------- 1 | \name{rp} 2 | \alias{fouter_file_path} 3 | \alias{router_custom_route} 4 | \alias{router_info} 5 | \alias{rp} 6 | \alias{set_fouter_file_path} 7 | \alias{set_router_custom_route} 8 | \alias{set_router_info} 9 | \title{Router Info} 10 | \description{ 11 | Router Info 12 | } 13 | \author{ 14 | Barret Schloerke 15 | } 16 | \keyword{internal} 17 | 18 | -------------------------------------------------------------------------------- /man/safely_order_funcs.Rd: -------------------------------------------------------------------------------- 1 | \name{safely_order_funcs} 2 | \alias{safely_order_funcs} 3 | \title{Order functions safely by name.} 4 | \usage{ 5 | safely_order_funcs(vect) 6 | } 7 | \arguments{ 8 | \item{vect}{string vector to be processed} 9 | } 10 | \description{ 11 | Order functions safely by name. 12 | } 13 | \author{ 14 | Barret Schloerke 15 | } 16 | \keyword{internal} 17 | 18 | -------------------------------------------------------------------------------- /man/save_picture.Rd: -------------------------------------------------------------------------------- 1 | \name{save_picture} 2 | \alias{save_picture} 3 | \title{Save a picture into the temp directory.} 4 | \usage{ 5 | save_picture(obj_name, obj_plot) 6 | } 7 | \value{ 8 | the path to the picture (using the website) 9 | } 10 | \description{ 11 | Save a picture into the temp directory. 12 | } 13 | \author{ 14 | Barret Schloerke 15 | } 16 | \keyword{internal} 17 | 18 | -------------------------------------------------------------------------------- /man/save_xml.Rd: -------------------------------------------------------------------------------- 1 | \name{save_xml} 2 | \alias{save_xml} 3 | \title{Save page info. 4 | Save page info into xml for solr} 5 | \usage{ 6 | save_xml(txt, file_name = tempfile()) 7 | } 8 | \arguments{ 9 | \item{txt}{xml text string} 10 | 11 | \item{file_name}{location to save the file. Defaults to a 12 | temp file that is discarded when R shuts down.} 13 | } 14 | \description{ 15 | Save page info. Save page info into xml for solr 16 | } 17 | \author{ 18 | Barret Schloerke 19 | } 20 | \keyword{internal} 21 | 22 | -------------------------------------------------------------------------------- /man/search_query_path.Rd: -------------------------------------------------------------------------------- 1 | \name{search_query_path} 2 | \alias{search_query_path} 3 | \title{Search query path. 4 | return a html path for a search} 5 | \usage{ 6 | search_query_path(query = "example", start_pos = 0) 7 | } 8 | \arguments{ 9 | \item{query}{query to be used} 10 | 11 | \item{start_pos}{postion to start at} 12 | } 13 | \description{ 14 | Search query path. return a html path for a search 15 | } 16 | \author{ 17 | Barret Schloerke 18 | } 19 | \keyword{internal} 20 | 21 | -------------------------------------------------------------------------------- /man/send_commit_command.Rd: -------------------------------------------------------------------------------- 1 | \name{send_commit_command} 2 | \alias{send_commit_command} 3 | \title{Send commit command to Solr 4 | Send a commit command to Solr to finalized any submissions} 5 | \description{ 6 | Send commit command to Solr Send a commit command to Solr 7 | to finalized any submissions 8 | } 9 | \author{ 10 | Barret Schloerke 11 | } 12 | \keyword{internal} 13 | 14 | -------------------------------------------------------------------------------- /man/send_system_command.Rd: -------------------------------------------------------------------------------- 1 | \name{send_system_command} 2 | \alias{send_system_command} 3 | \title{Send system command to Solr. 4 | Send a system command to Solr to add / update files to Solr} 5 | \usage{ 6 | send_system_command(system_string) 7 | } 8 | \description{ 9 | Send system command to Solr. Send a system command to 10 | Solr to add / update files to Solr 11 | } 12 | \author{ 13 | Barret Schloerke 14 | } 15 | \keyword{internal} 16 | 17 | -------------------------------------------------------------------------------- /man/servr_base_url.Rd: -------------------------------------------------------------------------------- 1 | \name{servr_base_url} 2 | \alias{servr_base_url} 3 | \title{Solr base URL.} 4 | \description{ 5 | Solr base URL. 6 | } 7 | \author{ 8 | Barret Schloerke 9 | } 10 | \keyword{internal} 11 | 12 | -------------------------------------------------------------------------------- /man/servr_combine_param.Rd: -------------------------------------------------------------------------------- 1 | \name{servr_combine_param} 2 | \alias{servr_combine_param} 3 | \title{Combine Solr parameters.} 4 | \usage{ 5 | servr_combine_param(value, param = names(value)) 6 | } 7 | \description{ 8 | Combine Solr parameters. 9 | } 10 | \author{ 11 | Barret Schloerke 12 | } 13 | \keyword{internal} 14 | 15 | -------------------------------------------------------------------------------- /man/servr_has_topic_in_example.Rd: -------------------------------------------------------------------------------- 1 | \name{servr_has_topic_in_example} 2 | \alias{servr_has_topic_in_example} 3 | \title{Solr Topics in Example} 4 | \usage{ 5 | servr_has_topic_in_example(topics) 6 | } 7 | \description{ 8 | Solr Topics in Example 9 | } 10 | \author{ 11 | Barret Schloerke 12 | } 13 | \keyword{internal} 14 | 15 | -------------------------------------------------------------------------------- /man/servr_similar.Rd: -------------------------------------------------------------------------------- 1 | \name{servr_similar} 2 | \alias{servr_similar} 3 | \title{Similar pages. 4 | Find related pages and return info in a data.frame} 5 | \usage{ 6 | servr_similar(topic) 7 | } 8 | \arguments{ 9 | \item{topic}{title to be used to find similar results} 10 | } 11 | \description{ 12 | Similar pages. Find related pages and return info in a 13 | data.frame 14 | } 15 | \author{ 16 | Barret Schloerke 17 | } 18 | \keyword{internal} 19 | 20 | -------------------------------------------------------------------------------- /man/simple_tags.Rd: -------------------------------------------------------------------------------- 1 | \name{simple_tags} 2 | \alias{simple_tags} 3 | \title{All tags that can be parsed in a simple way.} 4 | \description{ 5 | All tags that can be parsed in a simple way. 6 | } 7 | \author{ 8 | Hadley Wickham 9 | } 10 | \keyword{internal} 11 | 12 | -------------------------------------------------------------------------------- /man/solr_base_url.Rd: -------------------------------------------------------------------------------- 1 | \name{solr_base_url} 2 | \alias{solr_base_url} 3 | \title{Solr base URL.} 4 | \description{ 5 | Solr base URL. 6 | } 7 | \author{ 8 | Barret Schloerke 9 | } 10 | \keyword{internal} 11 | 12 | -------------------------------------------------------------------------------- /man/solr_combine_param.Rd: -------------------------------------------------------------------------------- 1 | \name{solr_combine_param} 2 | \alias{solr_combine_param} 3 | \title{Combine Solr parameters.} 4 | \usage{ 5 | solr_combine_param(value, param = names(value)) 6 | } 7 | \description{ 8 | Combine Solr parameters. 9 | } 10 | \author{ 11 | Barret Schloerke 12 | } 13 | \keyword{internal} 14 | 15 | -------------------------------------------------------------------------------- /man/solr_delete_package.Rd: -------------------------------------------------------------------------------- 1 | \name{solr_delete_package} 2 | \alias{solr_delete_package} 3 | \title{Deletes everything that belongs to a package in solr.} 4 | \usage{ 5 | solr_delete_package(package) 6 | } 7 | \arguments{ 8 | \item{package}{package to be deleted} 9 | } 10 | \description{ 11 | Deletes everything that belongs to a package in solr. 12 | } 13 | \author{ 14 | Barret Schloerke 15 | } 16 | 17 | -------------------------------------------------------------------------------- /man/solr_example_field.Rd: -------------------------------------------------------------------------------- 1 | \name{solr_example_field} 2 | \alias{solr_example_field} 3 | \title{Example query field.} 4 | \description{ 5 | Example query field. 6 | } 7 | \author{ 8 | Barret Schloerke 9 | } 10 | \keyword{internal} 11 | 12 | -------------------------------------------------------------------------------- /man/solr_has_topic_in_example.Rd: -------------------------------------------------------------------------------- 1 | \name{solr_has_topic_in_example} 2 | \alias{solr_has_topic_in_example} 3 | \title{Solr Topics in Example} 4 | \usage{ 5 | solr_has_topic_in_example(topics) 6 | } 7 | \description{ 8 | Solr Topics in Example 9 | } 10 | \author{ 11 | Barret Schloerke 12 | } 13 | \keyword{internal} 14 | 15 | -------------------------------------------------------------------------------- /man/solr_query_example_field.Rd: -------------------------------------------------------------------------------- 1 | \name{solr_query_example_field} 2 | \alias{solr_query_example_field} 3 | \title{Example query.} 4 | \usage{ 5 | solr_query_example_field(query, collapse = " OR ") 6 | } 7 | \description{ 8 | Example query. 9 | } 10 | \author{ 11 | Barret Schloerke 12 | } 13 | \keyword{internal} 14 | 15 | -------------------------------------------------------------------------------- /man/solr_query_topic_fields.Rd: -------------------------------------------------------------------------------- 1 | \name{solr_query_topic_fields} 2 | \alias{solr_query_topic_fields} 3 | \title{Topic query.} 4 | \usage{ 5 | solr_query_topic_fields(query, collapse = " OR ") 6 | } 7 | \description{ 8 | Topic query. 9 | } 10 | \author{ 11 | Barret Schloerke 12 | } 13 | \keyword{internal} 14 | 15 | -------------------------------------------------------------------------------- /man/solr_similar.Rd: -------------------------------------------------------------------------------- 1 | \name{solr_similar} 2 | \alias{solr_similar} 3 | \title{Similar pages. 4 | Find related pages and return info in a data.frame} 5 | \usage{ 6 | solr_similar(topic) 7 | } 8 | \arguments{ 9 | \item{topic}{title to be used to find similar results} 10 | } 11 | \description{ 12 | Similar pages. Find related pages and return info in a 13 | data.frame 14 | } 15 | \author{ 16 | Barret Schloerke 17 | } 18 | \keyword{internal} 19 | 20 | -------------------------------------------------------------------------------- /man/solr_topic.Rd: -------------------------------------------------------------------------------- 1 | \name{solr_topic} 2 | \alias{solr_topic} 3 | \title{Make Helpr topic into xml for solr.} 4 | \usage{ 5 | solr_topic(package, topic) 6 | } 7 | \arguments{ 8 | \item{package}{package to use} 9 | 10 | \item{topic}{topic to explore} 11 | } 12 | \description{ 13 | Make Helpr topic into xml for solr. 14 | } 15 | \author{ 16 | Barret Schloerke 17 | } 18 | \keyword{internal} 19 | 20 | -------------------------------------------------------------------------------- /man/solr_topic_fields.Rd: -------------------------------------------------------------------------------- 1 | \name{solr_topic_fields} 2 | \alias{solr_topic_fields} 3 | \title{Topic fields.} 4 | \description{ 5 | Topic fields. 6 | } 7 | \author{ 8 | Barret Schloerke 9 | } 10 | \keyword{internal} 11 | 12 | -------------------------------------------------------------------------------- /man/strip_html.Rd: -------------------------------------------------------------------------------- 1 | \name{strip_html} 2 | \alias{strip_html} 3 | \title{Strip HTML 4 | strip the HTML from a text string} 5 | \usage{ 6 | strip_html(x) 7 | } 8 | \arguments{ 9 | \item{x}{text string in question} 10 | } 11 | \description{ 12 | Strip HTML strip the HTML from a text string 13 | } 14 | \author{ 15 | Hadley Wickham 16 | } 17 | \keyword{internal} 18 | 19 | -------------------------------------------------------------------------------- /man/strong.Rd: -------------------------------------------------------------------------------- 1 | \name{strong} 2 | \alias{strong} 3 | \title{Strong HTML} 4 | \usage{ 5 | strong(x) 6 | } 7 | \description{ 8 | Strong HTML 9 | } 10 | \author{ 11 | Barret Schloerke 12 | } 13 | \keyword{internal} 14 | 15 | -------------------------------------------------------------------------------- /man/tag.Rd: -------------------------------------------------------------------------------- 1 | \name{tag} 2 | \alias{tag} 3 | \title{Tag an item} 4 | \usage{ 5 | tag(x) 6 | } 7 | \description{ 8 | Tag an item 9 | } 10 | \author{ 11 | Hadley Wickham 12 | } 13 | \keyword{internal} 14 | 15 | -------------------------------------------------------------------------------- /man/tag_link.Rd: -------------------------------------------------------------------------------- 1 | \name{tag_link} 2 | \alias{tag_link} 3 | \title{link to another topic} 4 | \usage{ 5 | tag_link(fun, pkg = NULL, topic_page = fun) 6 | } 7 | \arguments{ 8 | \item{fun}{function to tag} 9 | 10 | \item{pkg}{package to look in} 11 | 12 | \item{topic_page}{topic page of the function} 13 | } 14 | \description{ 15 | link to another topic 16 | } 17 | \author{ 18 | Hadley Wickham and Barret Schloerke 19 | } 20 | \keyword{internal} 21 | 22 | -------------------------------------------------------------------------------- /man/tag_simple.Rd: -------------------------------------------------------------------------------- 1 | \name{tag_simple} 2 | \alias{tag_simple} 3 | \title{tag a simple item 4 | tag an item that is contained in the simple tags list} 5 | \usage{ 6 | tag_simple(tag, text) 7 | } 8 | \arguments{ 9 | \item{tag}{tag looking for} 10 | 11 | \item{text}{text to go in the tag} 12 | } 13 | \description{ 14 | tag a simple item tag an item that is contained in the 15 | simple tags list 16 | } 17 | \author{ 18 | Hadley Wickham 19 | } 20 | \keyword{internal} 21 | 22 | -------------------------------------------------------------------------------- /man/ten_functions.Rd: -------------------------------------------------------------------------------- 1 | \name{ten_functions} 2 | \alias{ten_functions} 3 | \title{Both the top ten most called and last ten functions.} 4 | \value{ 5 | list containing the \code{\link{top_ten_functions}} and 6 | \code{\link{last_ten_functions}} 7 | } 8 | \description{ 9 | Both the top ten most called and last ten functions. 10 | } 11 | \author{ 12 | Barret Schloerke 13 | } 14 | \keyword{internal} 15 | 16 | -------------------------------------------------------------------------------- /man/top_ten_functions.Rd: -------------------------------------------------------------------------------- 1 | \name{top_ten_functions} 2 | \alias{top_ten_functions} 3 | \title{List top 10 most frequently called functions.} 4 | \usage{ 5 | top_ten_functions(fun_list = get_function_history()) 6 | } 7 | \arguments{ 8 | \item{fun_list}{function list} 9 | } 10 | \value{ 11 | fuctions that are from a package and their help paths 12 | } 13 | \description{ 14 | List top 10 most frequently called functions. 15 | } 16 | \author{ 17 | Barret Schloerke 18 | } 19 | \keyword{internal} 20 | 21 | -------------------------------------------------------------------------------- /man/topic_is_internal.Rd: -------------------------------------------------------------------------------- 1 | \name{topic_is_internal} 2 | \alias{topic_is_internal} 3 | \title{Internal topic function.} 4 | \usage{ 5 | topic_is_internal(help) 6 | } 7 | \arguments{ 8 | \item{help}{\code{pkg_topic(}\emph{\code{topic}}\code{)} 9 | is checked to see if a keyword is "internal"} 10 | } 11 | \value{ 12 | boolean 13 | } 14 | \description{ 15 | Internal topic function. 16 | } 17 | \author{ 18 | Barret Schloerke 19 | } 20 | \keyword{internal} 21 | 22 | -------------------------------------------------------------------------------- /man/untag.Rd: -------------------------------------------------------------------------------- 1 | \name{untag} 2 | \alias{untag} 3 | \title{Untag an item} 4 | \usage{ 5 | untag(x) 6 | } 7 | \description{ 8 | Untag an item 9 | } 10 | \author{ 11 | Hadley Wickham 12 | } 13 | \keyword{internal} 14 | 15 | -------------------------------------------------------------------------------- /man/update_packs.Rd: -------------------------------------------------------------------------------- 1 | \name{update_packs} 2 | \alias{update_packs} 3 | \title{Update all packages that are old and currently loaded or installed.} 4 | \usage{ 5 | update_packs(all = FALSE) 6 | } 7 | \description{ 8 | Update all packages that are old and currently loaded or 9 | installed. 10 | } 11 | \author{ 12 | Barret Schloerke 13 | } 14 | \keyword{internal} 15 | 16 | -------------------------------------------------------------------------------- /man/urlJSON_to_list.Rd: -------------------------------------------------------------------------------- 1 | \name{urlJSON_to_list} 2 | \alias{urlJSON_to_list} 3 | \title{URL with JSON result to list.} 4 | \usage{ 5 | urlJSON_to_list(url_string) 6 | } 7 | \arguments{ 8 | \item{url_string}{url that contains a JSON output to be 9 | turned into a list} 10 | } 11 | \description{ 12 | URL with JSON result to list. 13 | } 14 | \author{ 15 | Barret Schloerke 16 | } 17 | \keyword{internal} 18 | 19 | -------------------------------------------------------------------------------- /man/usage_functions.Rd: -------------------------------------------------------------------------------- 1 | \name{usage_functions} 2 | \alias{usage_functions} 3 | \title{Find all usage functions.} 4 | \usage{ 5 | usage_functions(usage) 6 | } 7 | \arguments{ 8 | \item{usage}{usage in question} 9 | } 10 | \description{ 11 | Find all usage functions. 12 | } 13 | \author{ 14 | Barret Schloerke 15 | } 16 | \keyword{internal} 17 | 18 | -------------------------------------------------------------------------------- /man/usage_methods.Rd: -------------------------------------------------------------------------------- 1 | \name{usage_methods} 2 | \alias{usage_methods} 3 | \title{Usage methods. 4 | find all methods within a usage} 5 | \usage{ 6 | usage_methods(usage) 7 | } 8 | \arguments{ 9 | \item{usage}{usage in question} 10 | } 11 | \description{ 12 | Usage methods. find all methods within a usage 13 | } 14 | \author{ 15 | Barret Schloerke 16 | } 17 | \keyword{internal} 18 | 19 | -------------------------------------------------------------------------------- /not-used/crantastic.r: -------------------------------------------------------------------------------- 1 | crantastic_rating <- function(pkg_name){ 2 | # require(RCurl) 3 | txt <- getURL(str_c("http://crantastic.org/packages/",pkg_name,"/")) 4 | rating_location <- str_locate(txt, "overall-rating")[,"start"] 5 | 6 | # retrieve the characters of overall-rating (and some extra) 7 | subString <- str_sub(txt, start = rating_location, end = rating_location+70) 8 | 9 | str_c(str_trim(str_split(subString, "\n")[[1]][2:3]), collapse = "
    ") 10 | } 11 | 12 | 13 | 14 | 15 | 16 | rating_text <- function(pkg_name){ 17 | rating_txt <- crantastic_rating(pkg_name) 18 | 19 | # get start position 20 | rating_value <- as.numeric(str_split(rating_txt,"/")[[1]][1]) 21 | 22 | star <- "" 23 | checked_star <- "" 24 | 25 | stars_txt <- c( 26 | rep(star, rating_value - 1), 27 | checked_star, 28 | rep(star, 5 - rating_value) 29 | ) 30 | 31 | stars_txt <- str_c(stars_txt, collapse = "" ) 32 | cran_txt <- str_c("http://crantastic.org/packages/", pkg_name) 33 | link_start <- str_c("") 34 | 35 | str_c(link_start, rating_txt, "", "
    ", stars_txt) 36 | } 37 | 38 | --------------------------------------------------------------------------------