diff --git a/puzzles/create_puzzles.R b/puzzles/create_puzzles.R new file mode 100644 index 00000000..76868d78 --- /dev/null +++ b/puzzles/create_puzzles.R @@ -0,0 +1,91 @@ +library(worrrd) +library(dplyr) +library(kableExtra) +library(grid) +library(gridExtra) + +# Simple wordsearch +words <- c("alligator", "crocodile", "squirrel", "swordfish", "german shepherd", "panda", "wolf") +x <- wordsearch(words, r = 20, c = 20) + + +png(file="puzzles/answers_search_ex.png") +plot(x, solution = TRUE, title = "Example Answers") +dev.off() + +pdf(file = "puzzles/example_search.pdf") +plot(x, solution = FALSE, title = "Example") +dev.off() + + +## crossword function +words <- row.names(state.x77) +clues <- paste0(state.region, " state covering ", scales::comma(state.x77[, "Area"]), " square miles.") +x <- crossword(words, clues, r = 40, c = 40) +plot(x, clues = TRUE, legend_size = 2) + +raw_func_info <- readRDS(file = "resources/raw_all_func_forpuzzles.rds") + +words <- raw_func_info$`./modules/R_files/Data_Cleaning.R`$`package:naniar` +x <- wordsearch(words, r = 20, c = 20) + + +pdf(file="puzzles/missing_data_search_answers.pdf") +plot(x, solution = TRUE, title = "Missing Data Answers") +dev.off() + +pdf(file="puzzles/missing_data_search.pdf") +plot(x, solution = FALSE, title = "Missing Data") +dev.off() + +cheatsheet_func_info <- read_csv(file = "resources/all_the_functions.csv") + +cheatsheet_func_info %>% filter(package == "naniar") +words <- cheatsheet_func_info %>% filter(package == "naniar")%>% pull(func) +clues <- cheatsheet_func_info %>% filter(package == "naniar") %>% pull(description) +x <- crossword(words, clues, r = 40, c = 40) +pdf(file="puzzles/missing_data_cross_word.pdf", width = 15) +plot(x, clues = TRUE) +dev.off() + +pdf(file="puzzles/missing_data_cross_word.pdf", width = 15) +plot(x, clues = TRUE) +dev.off() +clues <- tibble("clue" = clues) +clues <- clues %>% mutate(id = row_number()) +#clues <- clues %>% mutate(clue = +# str_replace_all(string = clue, pattern = "[.]", ".\n")) +clues_tab <- kbl(clues) +table_grob <- tableGrob(clues_tab) +pdf(file="puzzles/missing_data_cross_word2.pdf", width = 15) +grid.arrange(plot(x), table_grob, ncol = 1, heights = c(3,3)) +dev.off() + + + + +stringr_stuff <-cheatsheet_func_info %>% filter(package == "stringr") +stringr_stuff <- stringr_stuff %>% mutate(description = str_remove_all(description, pattern = "\\\\code\\{[^}]+\\}")) # remove code contents + +words <- stringr_stuff%>% pull(func) +clues <- stringr_stuff %>% pull(description) + +x <- crossword(words, clues, r = 40, c = 40) +pdf(file="puzzles/stringr_cross_word.pdf", width = 15) +plot(x, clues = TRUE) +dev.off() + +my_stringr_stuff <- tibble(func = c("str_detect", "str_extract", "str_remove", "str_sub", "str_subset", "str_replace"), + clue = c("logical of if pattern exists", "pulls out matching pattern", "removes pattern", "extracts a subset based on position", "pull values that match pattern", "replace pattern" ) +) + +words <- my_stringr_stuff%>% pull(func) +clues <- my_stringr_stuff %>% pull(clue) +x <- crossword(words, clues, r = 40, c = 40,method = "optimal") +pdf(file="puzzles/string_functions_cross_word.pdf", width = 15) +plot(x, clues = TRUE, title = "String Functions", legend_size = 4.5) +dev.off() + +pdf(file="puzzles/string_functions_cross_word.pdf", width = 15) +plot(x, clues = TRUE, title = "String Functions", legend_size = 4, solution = TRUE) +dev.off() diff --git a/resources/all_the_functions.csv b/resources/all_the_functions.csv new file mode 100644 index 00000000..dc9553fb --- /dev/null +++ b/resources/all_the_functions.csv @@ -0,0 +1,251 @@ +func,package,description +all.equal,base,"\code{all.equal(x, y)} is a utility to compare \R{} objects \code{x} and \code{y} testing `near equality'. If they are different, comparison is still made to some extent, and a report of the differences is returned. Do not use \code{all.equal} directly in \code{if} expressions---either use \code{isTRUE(all.equal(....))} or \code{\LinkA{identical}{identical}} if appropriate." +any,base,"Given a set of logical vectors, is at least one of the values true?" +as.character,base,"Create or test for objects of type \code{""character""}." +as.integer,base,"Creates or tests for objects of type \code{""integer""}." +as.logical,base,"Create or test for objects of type \code{""logical""}, and the basic logical constants." +as.numeric,base,"Creates or coerces objects of type \code{""numeric""}. \code{is.numeric} is a more general test of an object being interpretable as numbers." +c,base,"This is a generic function which combines its arguments. The default method combines its arguments to form a vector. All arguments are coerced to a common type which is the type of the returned value, and all attributes except names are removed." +cbind,base,"Take a sequence of vector, matrix or data-frame arguments and combine by \emph{c}olumns or \emph{r}ows, respectively. These are generic functions with methods for other \R{} classes." +class,base,\R{} possesses a simple generic function mechanism which can be used for an object-oriented style of programming. Method dispatch takes place based on the class of the first argument to the generic function. +colMeans,base,Form row and column sums and means for numeric arrays (or data frames). +colnames,base,Retrieve or set the row or column names of a matrix-like object. +data.frame,base,"The function \code{data.frame()} creates data frames, tightly coupled collections of variables which share many of the properties of matrices and of lists, used as the fundamental data structure by most of \R{}'s modeling software." +date,base,Returns a character string of the current system date and time. +difftime,base,"Time intervals creation, printing, and some arithmetic. The \code{\LinkA{print}{print}()} method calls these ``time differences''." +dim,base,Retrieve or set the dimension of an object. +expression,base,"Creates or tests for objects of mode and class \code{""expression""}." +factor,base,"The function \code{factor} is used to encode a vector as a factor (the terms `category' and `enumerated type' are also used for factors). If argument \code{ordered} is \code{TRUE}, the factor levels are assumed to be ordered. For compatibility with S there is also a function \code{ordered}. \code{is.factor}, \code{is.ordered}, \code{as.factor} and \code{as.ordered} are the membership and coercion functions for these classes." +getwd,base,\code{getwd} returns an absolute filepath representing the current working directory of the \R{} process; \code{setwd(dir)} is used to set the working directory to \code{dir}. +grep,base,"\code{grep}, \code{grepl}, \code{regexpr}, \code{gregexpr}, \code{regexec} and \code{gregexec} search for matches to argument \code{pattern} within each element of a character vector: they differ in the format of and amount of detail in the results. \code{sub} and \code{gsub} perform replacement of the first and all matches respectively." +gsub,base,"\code{grep}, \code{grepl}, \code{regexpr}, \code{gregexpr}, \code{regexec} and \code{gregexec} search for matches to argument \code{pattern} within each element of a character vector: they differ in the format of and amount of detail in the results. \code{sub} and \code{gsub} perform replacement of the first and all matches respectively." +is.infinite,base,"\code{is.finite} and \code{is.infinite} return a vector of the same length as \code{x}, indicating which elements are finite (not infinite and not missing) or infinite. \code{Inf} and \code{-Inf} are positive and negative infinity whereas \code{NaN} means `Not a Number'. (These apply to numeric values and real and imaginary parts of complex values but not to values of integer vectors.) \code{Inf} and \code{NaN} (as well as \code{\LinkA{NA}{NA}}) are \LinkA{reserved}{reserved} words in the \R{} language." +is.na,base,"\code{NA} is a logical constant of length 1 which contains a missing value indicator. \code{NA} can be coerced to any other vector type except raw. There are also constants \code{NA\_integer\_}, \code{NA\_real\_}, \code{NA\_complex\_} and \code{NA\_character\_} of the other atomic vector types which support missing values: all of these are \LinkA{reserved}{reserved} words in the \R{} language. The generic function \code{is.na} indicates which elements are missing. The generic function \code{is.na<-} sets elements to \code{NA}. The generic function \code{anyNA} implements \code{any(is.na(x))} in a possibly faster way (especially for atomic vectors)." +is.nan,base,"\code{is.finite} and \code{is.infinite} return a vector of the same length as \code{x}, indicating which elements are finite (not infinite and not missing) or infinite. \code{Inf} and \code{-Inf} are positive and negative infinity whereas \code{NaN} means `Not a Number'. (These apply to numeric values and real and imaginary parts of complex values but not to values of integer vectors.) \code{Inf} and \code{NaN} (as well as \code{\LinkA{NA}{NA}}) are \LinkA{reserved}{reserved} words in the \R{} language." +length,base,"Get or set the length of vectors (including lists) and factors, and of any other \R{} object for which a method has been defined." +levels,base,\code{levels} provides access to the levels attribute of a variable. The first form returns the value of the levels of its argument and the second sets the attribute. +library,base,\code{library} and \code{require} load and attach add-on packages. +list,base,"Functions to construct, coerce and check for both kinds of \R{} lists." +ls,base,"\code{ls} and \code{objects} return a vector of character strings giving the names of the objects in the specified environment. When invoked with no argument at the top level prompt, \code{ls} shows what data sets and functions a user has defined. When invoked with no argument inside a function, \code{ls} returns the names of the function's local variables: this is useful in conjunction with \code{browser}." +matrix,base,\code{matrix} creates a matrix from the given set of values. \code{as.matrix} attempts to turn its argument into a matrix. \code{is.matrix} tests if its argument is a (strict) matrix. +max,base,"Returns the (regular or \bold{p}arallel) maxima and minima of the input values. \code{pmax*()} and \code{pmin*()} take one or more vectors as arguments, recycle them to common length and return a single vector giving the \emph{`parallel'} maxima (or minima) of the argument vectors." +mean,base,Generic function for the (trimmed) arithmetic mean. +min,base,"Returns the (regular or \bold{p}arallel) maxima and minima of the input values. \code{pmax*()} and \code{pmin*()} take one or more vectors as arguments, recycle them to common length and return a single vector giving the \emph{`parallel'} maxima (or minima) of the argument vectors." +months,base,"Extract the weekday, month or quarter, or the Julian time (days since some origin). These are generic functions: the methods for the internal date-time classes are documented here." +ncol,base,"\code{nrow} and \code{ncol} return the number of rows or columns present in \code{x}. \code{NCOL} and \code{NROW} do the same treating a vector as 1-column matrix, even a 0-length vector, compatibly with \code{\LinkA{as.matrix}{as.matrix}()} or \code{\LinkA{cbind}{cbind}()}, see the example." +nrow,base,"\code{nrow} and \code{ncol} return the number of rows or columns present in \code{x}. \code{NCOL} and \code{NROW} do the same treating a vector as 1-column matrix, even a 0-length vector, compatibly with \code{\LinkA{as.matrix}{as.matrix}()} or \code{\LinkA{cbind}{cbind}()}, see the example." +options,base,Allow the user to set and examine a variety of global \emph{options} which affect the way in which \R{} computes and displays its results. +order,base,"\code{order} returns a permutation which rearranges its first argument into ascending or descending order, breaking ties by further arguments. \code{sort.list} does the same, using only one argument.\\{} See the examples for how to use these functions to sort data frames, etc." +paste,base,"Concatenate vectors after converting to character. Concatenation happens in two basically different ways, determined by \code{collapse} being a string or not." +paste0,base,"Concatenate vectors after converting to character. Concatenation happens in two basically different ways, determined by \code{collapse} being a string or not." +print,base,\code{print} prints its argument and returns it \emph{invisibly} (via \code{\LinkA{invisible}{invisible}(x)}). It is a generic function which means that new printing methods can be easily added for new \code{\LinkA{class}{class}}es. +range,base,\code{range} returns a vector containing the minimum and maximum of all the given arguments. +rep,base,"\code{rep} replicates the values in \code{x}. It is a generic function, and the (internal) default method is described here. \code{rep.int} and \code{rep\_len} are faster simplified versions for two common cases. Internally, they are generic, so methods can be defined for them (see \LinkA{InternalMethods}{InternalMethods})." +return,base,These functions provide the base mechanisms for defining new functions in the \R{} language. +rm,base,"\code{remove} and \code{rm} are identical \R{} functions that can be used to remove objects. These can be specified successively as character strings, or in the character vector \code{list}, or through a combination of both. All objects thus specified will be removed. If \code{envir} is NULL then the currently active environment is searched first. If \code{inherits} is \code{TRUE} then parents of the supplied directory are searched until a variable with the given name is encountered. A warning is printed for each variable that is not found." +round,base,"\code{ceiling} takes a single numeric argument \code{x} and returns a numeric vector containing the smallest integers not less than the corresponding elements of \code{x}. \code{floor} takes a single numeric argument \code{x} and returns a numeric vector containing the largest integers not greater than the corresponding elements of \code{x}. \code{trunc} takes a single numeric argument \code{x} and returns a numeric vector containing the integers formed by truncating the values in \code{x} toward \code{0}. \code{round} rounds the values in its first argument to the specified number of decimal places (default 0). See `Details' about ``round to even'' when rounding off a 5. \code{signif} rounds the values in its first argument to the specified number of \emph{significant} digits. Hence, for \code{numeric} \code{x}, \code{signif(x, dig)} is the same as \code{round(x, dig - ceiling(log10(abs(x))))}." +rowMeans,base,Form row and column sums and means for numeric arrays (or data frames). +rownames,base,Retrieve or set the row or column names of a matrix-like object. +sample,base,\code{sample} takes a sample of the specified size from the elements of \code{x} using either with or without replacement. +sapply,base,"\code{lapply} returns a list of the same length as \code{X}, each element of which is the result of applying \code{FUN} to the corresponding element of \code{X}. \code{sapply} is a user-friendly version and wrapper of \code{lapply} by default returning a vector, matrix or, if \code{simplify = ""array""}, an array if appropriate, by applying \code{simplify2array()}. \code{sapply(x, f, simplify = FALSE, USE.NAMES = FALSE)} is the same as \code{lapply(x, f)}. \code{vapply} is similar to \code{sapply}, but has a pre-specified type of return value, so it can be safer (and sometimes faster) to use. \code{replicate} is a wrapper for the common use of \code{sapply} for repeated evaluation of an expression (which will usually involve random number generation). \code{simplify2array()} is the utility called from \code{sapply()} when \code{simplify} is not false and is similarly called from \code{\LinkA{mapply}{mapply}()}." +save,base,"\code{save} writes an external representation of \R{} objects to the specified file. The objects can be read back from the file at a later date by using the function \code{\LinkA{load}{load}} or \code{\LinkA{attach}{attach}} (or \code{\LinkA{data}{data}} in some cases). \code{save.image()} is just a short-cut for `save my current workspace', i.e., \code{save(list = ls(all.names = TRUE), file = "".RData"", envir = .GlobalEnv)}. It is also what happens with \code{\LinkA{q}{q}(""yes"")}." +save.image,base,"\code{save} writes an external representation of \R{} objects to the specified file. The objects can be read back from the file at a later date by using the function \code{\LinkA{load}{load}} or \code{\LinkA{attach}{attach}} (or \code{\LinkA{data}{data}} in some cases). \code{save.image()} is just a short-cut for `save my current workspace', i.e., \code{save(list = ls(all.names = TRUE), file = "".RData"", envir = .GlobalEnv)}. It is also what happens with \code{\LinkA{q}{q}(""yes"")}." +seq,base,Generate regular sequences. \code{seq} is a standard generic with a default method. \code{seq.int} is a primitive which can be much faster but has a few restrictions. \code{seq\_along} and \code{seq\_len} are very fast primitives for two common cases. +set.seed,base,"\code{.Random.seed} is an integer vector, containing the random number generator (\abbr{RNG}) \bold{state} for random number generation in \R{}. It can be saved and restored, but should not be altered by the user. \code{RNGkind} is a more friendly interface to query or set the kind of RNG in use. \code{RNGversion} can be used to set the random generators as they were in an earlier \R{} version (for reproducibility). \code{set.seed} is the recommended way to specify seeds." +setdiff,base,"Performs \bold{set} union, intersection, (asymmetric!) difference, equality and membership on two vectors." +sort,base,"Sort (or \emph{order}) a vector or factor (partially) into ascending or descending order. For ordering along more than one variable, e.g., for sorting data frames, see \code{\LinkA{order}{order}}." +sum,base,\code{sum} returns the sum of all the values present in its arguments. +summary,base,\code{summary} is a generic function used to produce result summaries of the results of various model fitting functions. The function invokes particular \code{\LinkA{methods}{methods}} which depend on the \code{\LinkA{class}{class}} of the first argument. +suppressPackageStartupMessages,base,Generate a diagnostic message from its arguments. +suppressWarnings,base,Generates a warning message that corresponds to its argument(s) and (optionally) the expression or function from which it was called. +table,base,\code{table} uses cross-classifying factors to build a contingency table of the counts at each combination of factor levels. +toupper,base,"Translate characters in character vectors, in particular from upper to lower case or vice versa." +try,base,\code{try} is a wrapper to run an expression that might fail and allow the user's code to handle error-recovery. +typeof,base,\code{typeof} determines the (\R{} internal) type or storage mode of any object +unique,base,"\code{unique} returns a vector, data frame or array like \code{x} but with duplicate elements/rows removed." +unlist,base,"Given a list structure \code{x}, \code{unlist} simplifies it to produce a vector which contains all the atomic components which occur in \code{x}." +unloadNamespace,base,Functions to load and unload name spaces. +which,base,"Give the \code{TRUE} indices of a logical object, allowing for array indices." +tidy,broom,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[generics] \code{\LinkA{augment}{augment}}, \code{\LinkA{glance}{glance}}, \code{\LinkA{tidy}{tidy}} \end{description}" +corrplot,corrplot,"A graphical display of a correlation matrix, confidence interval. The details are paid great attention to. It can also visualize a general matrix by setting \code{is.corr = FALSE}." +direct.label,directlabels,"Add direct labels to a plot, and hide the color legend. Modern plotting packages like lattice and ggplot2 show automatic legends based on the variable specified for color, but these legends can be confusing if there are too many colors. Direct labels are a useful and clear alternative to a confusing legend in many common plots." +across,dplyr,"\code{across()} makes it easy to apply the same transformation to multiple columns, allowing you to use \code{\LinkA{select()}{select}} semantics inside in ""data-masking"" functions like \code{\LinkA{summarise()}{summarise}} and \code{\LinkA{mutate()}{mutate}}. See \code{vignette(""colwise"")} for more details. \code{if\_any()} and \code{if\_all()} apply the same predicate function to a selection of columns and combine the results into a single logical vector: \code{if\_any()} is \code{TRUE} when the predicate is \code{TRUE} for \emph{any} of the selected columns, \code{if\_all()} is \code{TRUE} when the predicate is \code{TRUE} for \emph{all} selected columns. If you just need to select columns without applying a transformation to each of them, then you probably want to use \code{\LinkA{pick()}{pick}} instead. \code{across()} supersedes the family of ""scoped variants"" like \code{summarise\_at()}, \code{summarise\_if()}, and \code{summarise\_all()}." +anti_join,dplyr,Filtering joins filter rows from \code{x} based on the presence or absence of matches in \code{y}: \begin{itemize} \item{} \code{semi\_join()} return all rows from \code{x} with a match in \code{y}. \item{} \code{anti\_join()} return all rows from \code{x} with\strong{out} a match in \code{y}. \end{itemize} +arrange,dplyr,"\code{arrange()} orders the rows of a data frame by the values of selected columns. Unlike other dplyr verbs, \code{arrange()} largely ignores grouping; you need to explicitly mention grouping variables (or use \code{.by\_group = TRUE}) in order to group by them, and functions of variables are evaluated once per data frame, not once per group." +as.tbl,dplyr,\strong{[Deprecated]} Please use \code{\LinkA{tibble::as\_tibble()}{tibble::as.Rul.tibble()}} instead. +case_when,dplyr,"This function allows you to vectorise multiple \code{\LinkA{if\_else()}{if.Rul.else}} statements. Each case is evaluated sequentially and the first match for each element determines the corresponding value in the output vector. If no cases match, the \code{.default} is used as a final ""else"" statment. \code{case\_when()} is an R equivalent of the SQL ""searched"" \AsIs{\texttt{CASE WHEN}} statement." +contains,dplyr,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[magrittr] \code{\LinkA{\Rpercent{}>\Rpercent{}}{.Rpcent.>.Rpcent.}} \item[pillar] \code{\LinkA{type\_sum}{type.Rul.sum}} \item[tibble] \code{\LinkA{add\_row}{add.Rul.row}}, \code{\LinkA{as\_data\_frame}{as.Rul.data.Rul.frame}}, \code{\LinkA{as\_tibble}{as.Rul.tibble}}, \code{\LinkA{data\_frame}{data.Rul.frame}}, \code{\LinkA{lst}{lst}}, \code{\LinkA{tibble}{tibble}}, \code{\LinkA{tribble}{tribble}}, \code{\LinkA{view}{view}} \item[tidyselect] \code{\LinkA{all\_of}{all.Rul.of}}, \code{\LinkA{any\_of}{any.Rul.of}}, \code{\LinkA{contains}{contains}}, \code{\LinkA{ends\_with}{ends.Rul.with}}, \code{\LinkA{everything}{everything}}, \code{\LinkA{last\_col}{last.Rul.col}}, \code{\LinkA{matches}{matches}}, \code{\LinkA{num\_range}{num.Rul.range}}, \code{\LinkA{one\_of}{one.Rul.of}}, \code{\LinkA{starts\_with}{starts.Rul.with}}, \code{\LinkA{where}{where}} \end{description}" +count,dplyr,"\code{count()} lets you quickly count the unique values of one or more variables: \code{df \%>\% count(a, b)} is roughly equivalent to \code{df \%>\% group\_by(a, b) \%>\% summarise(n = n())}. \code{count()} is paired with \code{tally()}, a lower-level helper that is equivalent to \code{df \%>\% summarise(n = n())}. Supply \code{wt} to perform weighted counts, switching the summary from \code{n = n()} to \code{n = sum(wt)}. \code{add\_count()} and \code{add\_tally()} are equivalents to \code{count()} and \code{tally()} but use \code{mutate()} instead of \code{summarise()} so that they add a new column with group-wise counts." +desc,dplyr,Transform a vector into a format that will be sorted in descending order. This is useful within \code{\LinkA{arrange()}{arrange}}. +distinct,dplyr,Keep only unique/distinct rows from a data frame. This is similar to \code{\LinkA{unique.data.frame()}{unique.data.frame}} but considerably faster. +ends_with,dplyr,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[magrittr] \code{\LinkA{\Rpercent{}>\Rpercent{}}{.Rpcent.>.Rpcent.}} \item[pillar] \code{\LinkA{type\_sum}{type.Rul.sum}} \item[tibble] \code{\LinkA{add\_row}{add.Rul.row}}, \code{\LinkA{as\_data\_frame}{as.Rul.data.Rul.frame}}, \code{\LinkA{as\_tibble}{as.Rul.tibble}}, \code{\LinkA{data\_frame}{data.Rul.frame}}, \code{\LinkA{lst}{lst}}, \code{\LinkA{tibble}{tibble}}, \code{\LinkA{tribble}{tribble}}, \code{\LinkA{view}{view}} \item[tidyselect] \code{\LinkA{all\_of}{all.Rul.of}}, \code{\LinkA{any\_of}{any.Rul.of}}, \code{\LinkA{contains}{contains}}, \code{\LinkA{ends\_with}{ends.Rul.with}}, \code{\LinkA{everything}{everything}}, \code{\LinkA{last\_col}{last.Rul.col}}, \code{\LinkA{matches}{matches}}, \code{\LinkA{num\_range}{num.Rul.range}}, \code{\LinkA{one\_of}{one.Rul.of}}, \code{\LinkA{starts\_with}{starts.Rul.with}}, \code{\LinkA{where}{where}} \end{description}" +everything,dplyr,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[magrittr] \code{\LinkA{\Rpercent{}>\Rpercent{}}{.Rpcent.>.Rpcent.}} \item[pillar] \code{\LinkA{type\_sum}{type.Rul.sum}} \item[tibble] \code{\LinkA{add\_row}{add.Rul.row}}, \code{\LinkA{as\_data\_frame}{as.Rul.data.Rul.frame}}, \code{\LinkA{as\_tibble}{as.Rul.tibble}}, \code{\LinkA{data\_frame}{data.Rul.frame}}, \code{\LinkA{lst}{lst}}, \code{\LinkA{tibble}{tibble}}, \code{\LinkA{tribble}{tribble}}, \code{\LinkA{view}{view}} \item[tidyselect] \code{\LinkA{all\_of}{all.Rul.of}}, \code{\LinkA{any\_of}{any.Rul.of}}, \code{\LinkA{contains}{contains}}, \code{\LinkA{ends\_with}{ends.Rul.with}}, \code{\LinkA{everything}{everything}}, \code{\LinkA{last\_col}{last.Rul.col}}, \code{\LinkA{matches}{matches}}, \code{\LinkA{num\_range}{num.Rul.range}}, \code{\LinkA{one\_of}{one.Rul.of}}, \code{\LinkA{starts\_with}{starts.Rul.with}}, \code{\LinkA{where}{where}} \end{description}" +filter,dplyr,"The \code{filter()} function is used to subset a data frame, retaining all rows that satisfy your conditions. To be retained, the row must produce a value of \code{TRUE} for all conditions. Note that when a condition evaluates to \code{NA} the row will be dropped, unlike base subsetting with \code{[}." +full_join,dplyr,"Mutating joins add columns from \code{y} to \code{x}, matching observations based on the keys. There are four mutating joins: the inner join, and the three outer joins. % \begin{SubSection}{Inner join} An \code{inner\_join()} only keeps observations from \code{x} that have a matching key in \code{y}. The most important property of an inner join is that unmatched rows in either input are not included in the result. This means that generally inner joins are not appropriate in most analyses, because it is too easy to lose observations. \end{SubSection} % \begin{SubSection}{Outer joins} The three outer joins keep observations that appear in at least one of the data frames: \begin{itemize} \item{} A \code{left\_join()} keeps all observations in \code{x}. \item{} A \code{right\_join()} keeps all observations in \code{y}. \item{} A \code{full\_join()} keeps all observations in \code{x} and \code{y}. \end{itemize} \end{SubSection} " +glimpse,dplyr,"\code{glimpse()} is like a transposed version of \code{print()}: columns run down the page, and data runs across. This makes it possible to see every column in a data frame. It's a little like \code{\LinkA{str()}{str}} applied to a data frame but it tries to show you as much data as possible. (And it always shows the underlying data, even when applied to a remote data source.) \code{glimpse()} is provided by the pillar package, and re-exported by dplyr. See \code{\LinkA{pillar::glimpse()}{pillar::glimpse()}} for more details." +group_by,dplyr,"Most data operations are done on groups defined by variables. \code{group\_by()} takes an existing tbl and converts it into a grouped tbl where operations are performed ""by group"". \code{ungroup()} removes grouping." +inner_join,dplyr,"Mutating joins add columns from \code{y} to \code{x}, matching observations based on the keys. There are four mutating joins: the inner join, and the three outer joins. % \begin{SubSection}{Inner join} An \code{inner\_join()} only keeps observations from \code{x} that have a matching key in \code{y}. The most important property of an inner join is that unmatched rows in either input are not included in the result. This means that generally inner joins are not appropriate in most analyses, because it is too easy to lose observations. \end{SubSection} % \begin{SubSection}{Outer joins} The three outer joins keep observations that appear in at least one of the data frames: \begin{itemize} \item{} A \code{left\_join()} keeps all observations in \code{x}. \item{} A \code{right\_join()} keeps all observations in \code{y}. \item{} A \code{full\_join()} keeps all observations in \code{x} and \code{y}. \end{itemize} \end{SubSection} " +left_join,dplyr,"Mutating joins add columns from \code{y} to \code{x}, matching observations based on the keys. There are four mutating joins: the inner join, and the three outer joins. % \begin{SubSection}{Inner join} An \code{inner\_join()} only keeps observations from \code{x} that have a matching key in \code{y}. The most important property of an inner join is that unmatched rows in either input are not included in the result. This means that generally inner joins are not appropriate in most analyses, because it is too easy to lose observations. \end{SubSection} % \begin{SubSection}{Outer joins} The three outer joins keep observations that appear in at least one of the data frames: \begin{itemize} \item{} A \code{left\_join()} keeps all observations in \code{x}. \item{} A \code{right\_join()} keeps all observations in \code{y}. \item{} A \code{full\_join()} keeps all observations in \code{x} and \code{y}. \end{itemize} \end{SubSection} " +mutate,dplyr,\code{mutate()} creates new columns that are functions of existing variables. It can also modify (if the name is the same as an existing column) and delete columns (by setting their value to \code{NULL}). +n,dplyr,"These functions return information about the ""current"" group or ""current"" variable, so only work inside specific contexts like \code{\LinkA{summarise()}{summarise}} and \code{\LinkA{mutate()}{mutate}}. \begin{itemize} \item{} \code{n()} gives the current group size. \item{} \code{cur\_group()} gives the group keys, a tibble with one row and one column for each grouping variable. \item{} \code{cur\_group\_id()} gives a unique numeric identifier for the current group. \item{} \code{cur\_group\_rows()} gives the row indices for the current group. \item{} \code{cur\_column()} gives the name of the current column (in \code{\LinkA{across()}{across}} only). \end{itemize} See \code{\LinkA{group\_data()}{group.Rul.data}} for equivalent functions that return values for all groups. See \code{\LinkA{pick()}{pick}} for a way to select a subset of columns using tidyselect syntax while inside \code{summarise()} or \code{mutate()}." +n_distinct,dplyr,\code{n\_distinct()} counts the number of unique/distinct combinations in a set of one or more vectors. It's a faster and more concise equivalent to \code{nrow(unique(data.frame(...)))}. +na_if,dplyr,This is a translation of the SQL command \code{NULLIF}. It is useful if you want to convert an annoying value to \code{NA}. +one_of,dplyr,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[magrittr] \code{\LinkA{\Rpercent{}>\Rpercent{}}{.Rpcent.>.Rpcent.}} \item[pillar] \code{\LinkA{type\_sum}{type.Rul.sum}} \item[tibble] \code{\LinkA{add\_row}{add.Rul.row}}, \code{\LinkA{as\_data\_frame}{as.Rul.data.Rul.frame}}, \code{\LinkA{as\_tibble}{as.Rul.tibble}}, \code{\LinkA{data\_frame}{data.Rul.frame}}, \code{\LinkA{lst}{lst}}, \code{\LinkA{tibble}{tibble}}, \code{\LinkA{tribble}{tribble}}, \code{\LinkA{view}{view}} \item[tidyselect] \code{\LinkA{all\_of}{all.Rul.of}}, \code{\LinkA{any\_of}{any.Rul.of}}, \code{\LinkA{contains}{contains}}, \code{\LinkA{ends\_with}{ends.Rul.with}}, \code{\LinkA{everything}{everything}}, \code{\LinkA{last\_col}{last.Rul.col}}, \code{\LinkA{matches}{matches}}, \code{\LinkA{num\_range}{num.Rul.range}}, \code{\LinkA{one\_of}{one.Rul.of}}, \code{\LinkA{starts\_with}{starts.Rul.with}}, \code{\LinkA{where}{where}} \end{description}" +pull,dplyr,"\code{pull()} is similar to \code{\$}. It's mostly useful because it looks a little nicer in pipes, it also works with remote data frames, and it can optionally name the output." +recode,dplyr,"\strong{[Superseded]} \code{recode()} is superseded in favor of \code{\LinkA{case\_match()}{case.Rul.match}}, which handles the most important cases of \code{recode()} with a more elegant interface. \code{recode\_factor()} is also superseded, however, its direct replacement is not currently available but will eventually live in \Rhref{https://forcats.tidyverse.org/}{forcats}. For creating new variables based on logical vectors, use \code{\LinkA{if\_else()}{if.Rul.else}}. For even more complicated criteria, use \code{\LinkA{case\_when()}{case.Rul.when}}. \code{recode()} is a vectorised version of \code{\LinkA{switch()}{switch}}: you can replace numeric values based on their position or their name, and character or factor values only by their name. This is an S3 generic: dplyr provides methods for numeric, character, and factors. You can use \code{recode()} directly with factors; it will preserve the existing order of levels while changing the values. Alternatively, you can use \code{recode\_factor()}, which will change the order of levels to match the order of replacements." +relocate,dplyr,"Use \code{relocate()} to change column positions, using the same syntax as \code{select()} to make it easy to move blocks of columns at once." +rename,dplyr,\code{rename()} changes the names of individual variables using \code{new\_name = old\_name} syntax; \code{rename\_with()} renames columns using a function. +rename_with,dplyr,\code{rename()} changes the names of individual variables using \code{new\_name = old\_name} syntax; \code{rename\_with()} renames columns using a function. +right_join,dplyr,"Mutating joins add columns from \code{y} to \code{x}, matching observations based on the keys. There are four mutating joins: the inner join, and the three outer joins. % \begin{SubSection}{Inner join} An \code{inner\_join()} only keeps observations from \code{x} that have a matching key in \code{y}. The most important property of an inner join is that unmatched rows in either input are not included in the result. This means that generally inner joins are not appropriate in most analyses, because it is too easy to lose observations. \end{SubSection} % \begin{SubSection}{Outer joins} The three outer joins keep observations that appear in at least one of the data frames: \begin{itemize} \item{} A \code{left\_join()} keeps all observations in \code{x}. \item{} A \code{right\_join()} keeps all observations in \code{y}. \item{} A \code{full\_join()} keeps all observations in \code{x} and \code{y}. \end{itemize} \end{SubSection} " +select,dplyr,"Select (and optionally rename) variables in a data frame, using a concise mini-language that makes it easy to refer to variables based on their name (e.g. \code{a:f} selects all columns from \code{a} on the left to \code{f} on the right) or type (e.g. \code{where(is.numeric)} selects all numeric columns). % \begin{SubSection}{Overview of selection features} Tidyverse selections implement a dialect of R where operators make it easy to select variables: \begin{itemize} \item{} \code{:} for selecting a range of consecutive variables. \item{} \code{!} for taking the complement of a set of variables. \item{} \code{\&} and \code{|} for selecting the intersection or the union of two sets of variables. \item{} \code{c()} for combining selections. \end{itemize} In addition, you can use \strong{selection helpers}. Some helpers select specific columns: \begin{itemize} \item{} \code{\LinkA{everything()}{everything()}}: Matches all variables. \item{} \code{\LinkA{last\_col()}{last.Rul.col()}}: Select last variable, possibly with an offset. \item{} \code{\LinkA{group\_cols()}{group.Rul.cols}}: Select all grouping columns. \end{itemize} Other helpers select variables by matching patterns in their names: \begin{itemize} \item{} \code{\LinkA{starts\_with()}{starts.Rul.with()}}: Starts with a prefix. \item{} \code{\LinkA{ends\_with()}{ends.Rul.with()}}: Ends with a suffix. \item{} \code{\LinkA{contains()}{contains()}}: Contains a literal string. \item{} \code{\LinkA{matches()}{matches()}}: Matches a regular expression. \item{} \code{\LinkA{num\_range()}{num.Rul.range()}}: Matches a numerical range like x01, x02, x03. \end{itemize} Or from variables stored in a character vector: \begin{itemize} \item{} \code{\LinkA{all\_of()}{all.Rul.of()}}: Matches variable names in a character vector. All names must be present, otherwise an out-of-bounds error is thrown. \item{} \code{\LinkA{any\_of()}{any.Rul.of()}}: Same as \code{all\_of()}, except that no error is thrown for names that don't exist. \end{itemize} Or using a predicate function: \begin{itemize} \item{} \code{\LinkA{where()}{where()}}: Applies a function to all variables and selects those for which the function returns \code{TRUE}. \end{itemize} \end{SubSection} " +setdiff,dplyr,"Perform set operations using the rows of a data frame. \begin{itemize} \item{} \code{intersect(x, y)} finds all rows in both \code{x} and \code{y}. \item{} \code{union(x, y)} finds all rows in either \code{x} or \code{y}, excluding duplicates. \item{} \code{union\_all(x, y)} finds all rows in either \code{x} or \code{y}, including duplicates. \item{} \code{setdiff(x, y)} finds all rows in \code{x} that aren't in \code{y}. \item{} \code{symdiff(x, y)} computes the symmetric difference, i.e. all rows in \code{x} that aren't in \code{y} and all rows in \code{y} that aren't in \code{x}. \item{} \code{setequal(x, y)} returns \code{TRUE} if \code{x} and \code{y} contain the same rows (ignoring order). \end{itemize} Note that \code{intersect()}, \code{union()}, \code{setdiff()}, and \code{symdiff()} remove duplicates in \code{x} and \code{y}." +slice_sample,dplyr,"\code{slice()} lets you index rows by their (integer) locations. It allows you to select, remove, and duplicate rows. It is accompanied by a number of helpers for common use cases: \begin{itemize} \item{} \code{slice\_head()} and \code{slice\_tail()} select the first or last rows. \item{} \code{slice\_sample()} randomly selects rows. \item{} \code{slice\_min()} and \code{slice\_max()} select rows with the smallest or largest values of a variable. \end{itemize} If \code{.data} is a \LinkA{grouped\_df}{grouped.Rul.df}, the operation will be performed on each group, so that (e.g.) \code{slice\_head(df, n = 5)} will select the first five rows in each group." +starts_with,dplyr,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[magrittr] \code{\LinkA{\Rpercent{}>\Rpercent{}}{.Rpcent.>.Rpcent.}} \item[pillar] \code{\LinkA{type\_sum}{type.Rul.sum}} \item[tibble] \code{\LinkA{add\_row}{add.Rul.row}}, \code{\LinkA{as\_data\_frame}{as.Rul.data.Rul.frame}}, \code{\LinkA{as\_tibble}{as.Rul.tibble}}, \code{\LinkA{data\_frame}{data.Rul.frame}}, \code{\LinkA{lst}{lst}}, \code{\LinkA{tibble}{tibble}}, \code{\LinkA{tribble}{tribble}}, \code{\LinkA{view}{view}} \item[tidyselect] \code{\LinkA{all\_of}{all.Rul.of}}, \code{\LinkA{any\_of}{any.Rul.of}}, \code{\LinkA{contains}{contains}}, \code{\LinkA{ends\_with}{ends.Rul.with}}, \code{\LinkA{everything}{everything}}, \code{\LinkA{last\_col}{last.Rul.col}}, \code{\LinkA{matches}{matches}}, \code{\LinkA{num\_range}{num.Rul.range}}, \code{\LinkA{one\_of}{one.Rul.of}}, \code{\LinkA{starts\_with}{starts.Rul.with}}, \code{\LinkA{where}{where}} \end{description}" +summarise,dplyr,"\code{summarise()} creates a new data frame. It returns one row for each combination of grouping variables; if there are no grouping variables, the output will have a single row summarising all observations in the input. It will contain one column for each grouping variable and one column for each of the summary statistics that you have specified. \code{summarise()} and \code{summarize()} are synonyms." +summarize,dplyr,"\code{summarise()} creates a new data frame. It returns one row for each combination of grouping variables; if there are no grouping variables, the output will have a single row summarising all observations in the input. It will contain one column for each grouping variable and one column for each of the summary statistics that you have specified. \code{summarise()} and \code{summarize()} are synonyms." +tally,dplyr,"\code{count()} lets you quickly count the unique values of one or more variables: \code{df \%>\% count(a, b)} is roughly equivalent to \code{df \%>\% group\_by(a, b) \%>\% summarise(n = n())}. \code{count()} is paired with \code{tally()}, a lower-level helper that is equivalent to \code{df \%>\% summarise(n = n())}. Supply \code{wt} to perform weighted counts, switching the summary from \code{n = n()} to \code{n = sum(wt)}. \code{add\_count()} and \code{add\_tally()} are equivalents to \code{count()} and \code{tally()} but use \code{mutate()} instead of \code{summarise()} so that they add a new column with group-wise counts." +tibble,dplyr,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[magrittr] \code{\LinkA{\Rpercent{}>\Rpercent{}}{.Rpcent.>.Rpcent.}} \item[pillar] \code{\LinkA{type\_sum}{type.Rul.sum}} \item[tibble] \code{\LinkA{add\_row}{add.Rul.row}}, \code{\LinkA{as\_data\_frame}{as.Rul.data.Rul.frame}}, \code{\LinkA{as\_tibble}{as.Rul.tibble}}, \code{\LinkA{data\_frame}{data.Rul.frame}}, \code{\LinkA{lst}{lst}}, \code{\LinkA{tibble}{tibble}}, \code{\LinkA{tribble}{tribble}}, \code{\LinkA{view}{view}} \item[tidyselect] \code{\LinkA{all\_of}{all.Rul.of}}, \code{\LinkA{any\_of}{any.Rul.of}}, \code{\LinkA{contains}{contains}}, \code{\LinkA{ends\_with}{ends.Rul.with}}, \code{\LinkA{everything}{everything}}, \code{\LinkA{last\_col}{last.Rul.col}}, \code{\LinkA{matches}{matches}}, \code{\LinkA{num\_range}{num.Rul.range}}, \code{\LinkA{one\_of}{one.Rul.of}}, \code{\LinkA{starts\_with}{starts.Rul.with}}, \code{\LinkA{where}{where}} \end{description}" +transmute,dplyr,"\strong{[Superseded]} \code{transmute()} creates a new data frame containing only the specified computations. It's superseded because you can perform the same job with \code{mutate(.keep = ""none"")}." +vars,dplyr,"\strong{[Superseded]} \code{vars()} is superseded because it is only needed for the scoped verbs (i.e. \code{\LinkA{mutate\_at()}{mutate.Rul.at}}, \code{\LinkA{summarise\_at()}{summarise.Rul.at}}, and friends), which have been been superseded in favour of \code{\LinkA{across()}{across}}. See \code{vignette(""colwise"")} for details. This helper is intended to provide tidy-select semantics for scoped verbs like \code{mutate\_at()} and \code{summarise\_at()}. Note that anywhere you can supply \code{vars()} specification, you can also supply a numeric vector of column positions or a character vector of column names." +where,dplyr,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[magrittr] \code{\LinkA{\Rpercent{}>\Rpercent{}}{.Rpcent.>.Rpcent.}} \item[pillar] \code{\LinkA{type\_sum}{type.Rul.sum}} \item[tibble] \code{\LinkA{add\_row}{add.Rul.row}}, \code{\LinkA{as\_data\_frame}{as.Rul.data.Rul.frame}}, \code{\LinkA{as\_tibble}{as.Rul.tibble}}, \code{\LinkA{data\_frame}{data.Rul.frame}}, \code{\LinkA{lst}{lst}}, \code{\LinkA{tibble}{tibble}}, \code{\LinkA{tribble}{tribble}}, \code{\LinkA{view}{view}} \item[tidyselect] \code{\LinkA{all\_of}{all.Rul.of}}, \code{\LinkA{any\_of}{any.Rul.of}}, \code{\LinkA{contains}{contains}}, \code{\LinkA{ends\_with}{ends.Rul.with}}, \code{\LinkA{everything}{everything}}, \code{\LinkA{last\_col}{last.Rul.col}}, \code{\LinkA{matches}{matches}}, \code{\LinkA{num\_range}{num.Rul.range}}, \code{\LinkA{one\_of}{one.Rul.of}}, \code{\LinkA{starts\_with}{starts.Rul.with}}, \code{\LinkA{where}{where}} \end{description}" +oddsratio,epitools,"Calculates odds ratio by median-unbiased estimation (mid-p), conditional maximum likelihood estimation (Fisher), unconditional maximum likelihood estimation (Wald), and small sample adjustment (small). Confidence intervals are calculated using exact methods (mid-p and Fisher), normal approximation (Wald), and normal approximation with small sample adjustment (small). " +as_factor,forcats,"Compared to base R, when \code{x} is a character, this function creates levels in the order in which they appear, which will be the same on every platform. (Base R sorts in the current locale which can vary from place to place.) When \code{x} is numeric, the ordering is based on the numeric value and consistent with base R." +fct_count,forcats,Count entries in a factor +fct_reorder,forcats,\code{fct\_reorder()} is useful for 1d displays where the factor is mapped to position; \code{fct\_reorder2()} for 2d displays where the factor is mapped to a non-position aesthetic. \code{last2()} and \code{first2()} are helpers for \code{fct\_reorder2()}; \code{last2()} finds the last value of \code{y} when sorted by \code{x}; \code{first2()} finds the first value. +aes,ggplot2,Aesthetic mappings describe how variables in the data are mapped to visual properties (aesthetics) of geoms. Aesthetic mappings can be set in \code{\LinkA{ggplot()}{ggplot}} and in individual layers. +annotate,ggplot2,"This function adds geoms to a plot, but unlike a typical geom function, the properties of the geoms are not mapped from variables of a data frame, but are instead passed in as vectors. This is useful for adding small annotations (such as text labels) or if you have your data in vectors, and for some reason don't want to put them in a data frame." +coord_flip,ggplot2,"\strong{[Superseded]} This function is superseded because in many cases, \code{coord\_flip()} can easily be replaced by swapping the x and y aesthetics, or optionally setting the \code{orientation} argument in geom and stat layers. \code{coord\_flip()} is useful for geoms and statistics that do not support the \code{orientation} setting, and converting the display of y conditional on x, to x conditional on y." +element_text,ggplot2,"In conjunction with the \LinkA{theme}{theme} system, the \code{element\_} functions specify the display of how non-data components of the plot are drawn. \begin{itemize} \item{} \code{element\_blank()}: draws nothing, and assigns no space. \item{} \code{element\_rect()}: borders and backgrounds. \item{} \code{element\_line()}: lines. \item{} \code{element\_text()}: text. \end{itemize} \code{rel()} is used to specify sizes relative to the parent, \code{margin()} is used to specify the margins of elements." +facet_grid,ggplot2,"\code{facet\_grid()} forms a matrix of panels defined by row and column faceting variables. It is most useful when you have two discrete variables, and all combinations of the variables exist in the data. If you have only one variable with many levels, try \code{\LinkA{facet\_wrap()}{facet.Rul.wrap}}." +facet_wrap,ggplot2,\code{facet\_wrap()} wraps a 1d sequence of panels into 2d. This is generally a better use of screen space than \code{\LinkA{facet\_grid()}{facet.Rul.grid}} because most displays are roughly rectangular. +geom_bar,ggplot2,"There are two types of bar charts: \code{geom\_bar()} and \code{geom\_col()}. \code{geom\_bar()} makes the height of the bar proportional to the number of cases in each group (or if the \code{weight} aesthetic is supplied, the sum of the weights). If you want the heights of the bars to represent values in the data, use \code{geom\_col()} instead. \code{geom\_bar()} uses \code{stat\_count()} by default: it counts the number of cases at each x position. \code{geom\_col()} uses \code{stat\_identity()}: it leaves the data as is." +geom_boxplot,ggplot2,"The boxplot compactly displays the distribution of a continuous variable. It visualises five summary statistics (the median, two hinges and two whiskers), and all ""outlying"" points individually." +geom_col,ggplot2,"There are two types of bar charts: \code{geom\_bar()} and \code{geom\_col()}. \code{geom\_bar()} makes the height of the bar proportional to the number of cases in each group (or if the \code{weight} aesthetic is supplied, the sum of the weights). If you want the heights of the bars to represent values in the data, use \code{geom\_col()} instead. \code{geom\_bar()} uses \code{stat\_count()} by default: it counts the number of cases at each x position. \code{geom\_col()} uses \code{stat\_identity()}: it leaves the data as is." +geom_jitter,ggplot2,"The jitter geom is a convenient shortcut for \code{geom\_point(position = ""jitter"")}. It adds a small amount of random variation to the location of each point, and is a useful way of handling overplotting caused by discreteness in smaller datasets." +geom_label,ggplot2,"Text geoms are useful for labeling plots. They can be used by themselves as scatterplots or in combination with other geoms, for example, for labeling points or for annotating the height of bars. \code{geom\_text()} adds only text to the plot. \code{geom\_label()} draws a rectangle behind the text, making it easier to read." +geom_line,ggplot2,"\code{geom\_path()} connects the observations in the order in which they appear in the data. \code{geom\_line()} connects them in order of the variable on the x axis. \code{geom\_step()} creates a stairstep plot, highlighting exactly when changes occur. The \code{group} aesthetic determines which cases are connected together." +geom_point,ggplot2,"The point geom is used to create scatterplots. The scatterplot is most useful for displaying the relationship between two continuous variables. It can be used to compare one continuous and one categorical variable, or two categorical variables, but a variation like \code{\LinkA{geom\_jitter()}{geom.Rul.jitter}}, \code{\LinkA{geom\_count()}{geom.Rul.count}}, or \code{\LinkA{geom\_bin\_2d()}{geom.Rul.bin.Rul.2d}} is usually more appropriate. A \emph{bubblechart} is a scatterplot with a third variable mapped to the size of points." +geom_smooth,ggplot2,Aids the eye in seeing patterns in the presence of overplotting. \code{geom\_smooth()} and \code{stat\_smooth()} are effectively aliases: they both use the same arguments. Use \code{stat\_smooth()} if you want to display the results with a non-standard geom. +ggplot,ggplot2,\code{ggplot()} initializes a ggplot object. It can be used to declare the input data frame for a graphic and to specify the set of plot aesthetics intended to be common throughout all subsequent layers unless specifically overridden. +ggsave,ggplot2,"\code{ggsave()} is a convenient function for saving a plot. It defaults to saving the last plot that you displayed, using the size of the current graphics device. It also guesses the type of graphics device from the extension." +labs,ggplot2,Good labels are critical for making your plots accessible to a wider audience. Always ensure the axis and legend labels display the full variable name. Use the plot \code{title} and \code{subtitle} to explain the main findings. It's common to use the \code{caption} to provide information about the data source. \code{tag} can be used for adding identification tags to differentiate between multiple plots. +scale_color_hue,ggplot2,Maps each level to an evenly spaced hue on the colour wheel. It does not generate colour-blind safe palettes. +scale_colour_manual,ggplot2,These functions allow you to specify your own set of mappings from levels in the data to aesthetic values. +scale_fill_viridis_d,ggplot2,The \code{viridis} scales provide colour maps that are perceptually uniform in both colour and black-and-white. They are also designed to be perceived by viewers with common forms of colour blindness. See also \url{https://bids.github.io/colormap/}. +scale_x_continuous,ggplot2,"\code{scale\_x\_continuous()} and \code{scale\_y\_continuous()} are the default scales for continuous x and y aesthetics. There are three variants that set the \code{transform} argument for commonly used transformations: \AsIs{\texttt{scale\_*\_log10()}}, \AsIs{\texttt{scale\_*\_sqrt()}} and \AsIs{\texttt{scale\_*\_reverse()}}." +theme,ggplot2,"Themes are a powerful way to customize the non-data components of your plots: i.e. titles, labels, fonts, background, gridlines, and legends. Themes can be used to give plots a consistent customized look. Modify a single plot's theme using \code{theme()}; see \code{\LinkA{theme\_update()}{theme.Rul.update}} if you want modify the active theme, to affect all subsequent plots. Use the themes available in \LinkA{complete themes}{theme.Rul.bw} if you would like to use a complete theme such as \code{theme\_bw()}, \code{theme\_minimal()}, and more. Theme elements are documented together according to inheritance, read more about theme inheritance below." +theme_bw,ggplot2,These are complete themes which control all non-data display. Use \code{\LinkA{theme()}{theme}} if you just need to tweak the display of an existing theme. +theme_classic,ggplot2,These are complete themes which control all non-data display. Use \code{\LinkA{theme()}{theme}} if you just need to tweak the display of an existing theme. +theme_dark,ggplot2,These are complete themes which control all non-data display. Use \code{\LinkA{theme()}{theme}} if you just need to tweak the display of an existing theme. +theme_gray,ggplot2,These are complete themes which control all non-data display. Use \code{\LinkA{theme()}{theme}} if you just need to tweak the display of an existing theme. +theme_linedraw,ggplot2,These are complete themes which control all non-data display. Use \code{\LinkA{theme()}{theme}} if you just need to tweak the display of an existing theme. +theme_minimal,ggplot2,These are complete themes which control all non-data display. Use \code{\LinkA{theme()}{theme}} if you just need to tweak the display of an existing theme. +theme_void,ggplot2,These are complete themes which control all non-data display. Use \code{\LinkA{theme()}{theme}} if you just need to tweak the display of an existing theme. +vars,ggplot2,"Just like \code{\LinkA{aes()}{aes}}, \code{vars()} is a \LinkA{quoting function}{quoting function} that takes inputs to be evaluated in the context of a dataset. These inputs can be: \begin{itemize} \item{} variable names \item{} complex expressions \end{itemize} In both cases, the results (the vectors that the variable represents or the results of the expressions) are used to form faceting groups." +xlab,ggplot2,Good labels are critical for making your plots accessible to a wider audience. Always ensure the axis and legend labels display the full variable name. Use the plot \code{title} and \code{subtitle} to explain the main findings. It's common to use the \code{caption} to provide information about the data source. \code{tag} can be used for adding identification tags to differentiate between multiple plots. +ylab,ggplot2,Good labels are critical for making your plots accessible to a wider audience. Always ensure the axis and legend labels display the full variable name. Use the plot \code{title} and \code{subtitle} to explain the main findings. It's common to use the \code{caption} to provide information about the data source. \code{tag} can be used for adding identification tags to differentiate between multiple plots. +ylim,ggplot2,"This is a shortcut for supplying the \code{limits} argument to the individual scales. By default, any values outside the limits specified are replaced with \code{NA}. Be warned that this will remove data outside the limits and this can produce unintended results. For changing x or y axis limits \strong{without} dropping data observations, see \code{\LinkA{coord\_cartesian()}{coord.Rul.cartesian}}." +boxplot,graphics,Produce box-and-whisker plot(s) of the given (grouped) values. +here,here,"\code{here()} uses a reasonable heuristics to find your project's files, based on the current working directory at the time when the package is loaded. Use it as a drop-in replacement for \code{\LinkA{file.path()}{file.path}}, it will always locate the files relative to your project root." +clean_names,janitor,"Resulting names are unique and consist only of the \code{\_} character, numbers, and letters. Capitalization preferences can be specified using the \code{case} parameter. Accented characters are transliterated to ASCII. For example, an ""o"" with a German umlaut over it becomes ""o"", and the Spanish character ""enye"" becomes ""n"". This function takes and returns a data.frame, for ease of piping with \code{`\%>\%`}. For the underlying function that works on a character vector of names, see \code{\LinkA{make\_clean\_names}{make.Rul.clean.Rul.names}}. \code{clean\_names} relies on the versatile function \code{\LinkA{to\_any\_case}{to.Rul.any.Rul.case}}, which accepts many arguments. See that function's documentation for ideas on getting the most out of \code{clean\_names}. A few examples are included below. A common issue is that the micro/mu symbol is replaced by ""m"" instead of ""u"". The replacement with ""m"" is more correct when doing Greek-to-ASCII transliteration but less correct when doing scientific data-to-ASCII transliteration. A warning will be generated if the ""m"" replacement occurs. To replace with ""u"", please add the argument \code{replace=janitor:::mu\_to\_u} which is a character vector mapping all known mu or micro Unicode code points (characters) to ""u""." +include_graphics,knitr,"When plots are not generated from R code, there is no way for \pkg{knitr} to capture plots automatically. In this case, you may generate the images manually and pass their file paths to this function to include them in the output. The major advantage of using this function is that it is portable in the sense that it works for all document formats that \pkg{knitr} supports, so you do not need to think if you have to use, for example, LaTeX or Markdown syntax, to embed an external image. Chunk options related to graphics output that work for normal R plots also work for these images, such as \code{out.width} and \code{out.height}." +date,lubridate,"Date-time must be a POSIXct, POSIXlt, Date, chron, yearmon, yearqtr, zoo, zooreg, timeDate, xts, its, ti, jul, timeSeries, and fts objects." +day,lubridate,Get/set days component of a date-time +days,lubridate,\code{period()} creates or parses a period object with the specified values. +dmy,lubridate,"Transforms dates stored in character and numeric vectors to Date or POSIXct objects (see \code{tz} argument). These functions recognize arbitrary non-digit separators as well as no separator. As long as the order of formats is correct, these functions will parse dates correctly even when the input vectors contain differently formatted dates. See examples." +floor_date,lubridate,"\code{round\_date()} takes a date-time object and time unit, and rounds it to the nearest value of the specified time unit. For rounding date-times which are exactly halfway between two consecutive units, the convention is to round up. Note that this is in line with the behavior of R's \code{\LinkA{base::round.POSIXt()}{base::round.POSIXt()}} function but does not follow the convention of the base \code{\LinkA{base::round()}{base::round()}} function which ""rounds to the even digit"", as per IEC 60559. Rounding to the nearest unit or multiple of a unit is supported. All meaningful specifications in the English language are supported - secs, min, mins, 2 minutes, 3 years etc. Rounding to fractional seconds is also supported. Please note that rounding to fractions smaller than 1 second can lead to large precision errors due to the floating point representation of the POSIXct objects. See examples. \code{floor\_date()} takes a date-time object and rounds it down to the nearest boundary of the specified time unit. \code{ceiling\_date()} takes a date-time object and rounds it up to the nearest boundary of the specified time unit." +hours,lubridate,\code{period()} creates or parses a period object with the specified values. +mdy,lubridate,"Transforms dates stored in character and numeric vectors to Date or POSIXct objects (see \code{tz} argument). These functions recognize arbitrary non-digit separators as well as no separator. As long as the order of formats is correct, these functions will parse dates correctly even when the input vectors contain differently formatted dates. See examples." +setdiff,lubridate,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[generics] \code{\LinkA{as.difftime}{as.difftime}}, \code{\LinkA{intersect}{intersect}}, \code{\LinkA{setdiff}{setdiff}}, \code{\LinkA{union}{union}} \end{description}" +wday,lubridate,Get/set days component of a date-time +ymd,lubridate,"Transforms dates stored in character and numeric vectors to Date or POSIXct objects (see \code{tz} argument). These functions recognize arbitrary non-digit separators as well as no separator. As long as the order of formats is correct, these functions will parse dates correctly even when the input vectors contain differently formatted dates. See examples." +ymd_hms,lubridate,"Transform dates stored as character or numeric vectors to POSIXct objects. The \code{ymd\_hms()} family of functions recognizes all non-alphanumeric separators (with the exception of ""."" if \code{frac = TRUE}) and correctly handles heterogeneous date-time representations. For more flexibility in treatment of heterogeneous formats, see low level parser \code{\LinkA{parse\_date\_time()}{parse.Rul.date.Rul.time}}." +gg_miss_var,naniar,"This is a visual analogue to \code{miss\_var\_summary}. It draws a ggplot of the number of missings in each variable, ordered to show which variables have the most missing data. A default minimal theme is used, which can be customised as normal for ggplot." +miss_var_summary,naniar,"Provide a summary for each variable of the number, percent missings, and cumulative sum of missings of the order of the variables. By default, it orders by the most missings in each variable." +miss_var_which,naniar,It can be helpful when writing other functions to just return the names of the variables that contain missing values. \code{miss\_var\_which} returns a vector of variable names that contain missings. It will return NULL when there are no missings. +n_complete_row,naniar,Substitute for \code{rowSums(!is.na(data))} but it also checks if input is NULL or is a dataframe +pct_complete,naniar,The complement to \code{pct\_miss} +include_slide,ottrpal,Get Google Slide PNG URL +arrange,plotly,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[dplyr] \code{\LinkA{arrange}{arrange}}, \code{\LinkA{arrange\_}{arrange.Rul.}}, \code{\LinkA{distinct}{distinct}}, \code{\LinkA{distinct\_}{distinct.Rul.}}, \code{\LinkA{do}{do}}, \code{\LinkA{do\_}{do.Rul.}}, \code{\LinkA{filter}{filter}}, \code{\LinkA{filter\_}{filter.Rul.}}, \code{\LinkA{group\_by}{group.Rul.by}}, \code{\LinkA{group\_by\_}{group.Rul.by.Rul.}}, \code{\LinkA{groups}{groups}}, \code{\LinkA{mutate}{mutate}}, \code{\LinkA{mutate\_}{mutate.Rul.}}, \code{\LinkA{rename}{rename}}, \code{\LinkA{rename\_}{rename.Rul.}}, \code{\LinkA{select}{select}}, \code{\LinkA{select\_}{select.Rul.}}, \code{\LinkA{slice}{slice}}, \code{\LinkA{slice\_}{slice.Rul.}}, \code{\LinkA{summarise}{summarise}}, \code{\LinkA{summarise\_}{summarise.Rul.}}, \code{\LinkA{transmute}{transmute}}, \code{\LinkA{transmute\_}{transmute.Rul.}}, \code{\LinkA{ungroup}{ungroup}} \item[magrittr] \code{\LinkA{\Rpercent{}>\Rpercent{}}{.Rpcent.>.Rpcent.}} \end{description}" +distinct,plotly,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[dplyr] \code{\LinkA{arrange}{arrange}}, \code{\LinkA{arrange\_}{arrange.Rul.}}, \code{\LinkA{distinct}{distinct}}, \code{\LinkA{distinct\_}{distinct.Rul.}}, \code{\LinkA{do}{do}}, \code{\LinkA{do\_}{do.Rul.}}, \code{\LinkA{filter}{filter}}, \code{\LinkA{filter\_}{filter.Rul.}}, \code{\LinkA{group\_by}{group.Rul.by}}, \code{\LinkA{group\_by\_}{group.Rul.by.Rul.}}, \code{\LinkA{groups}{groups}}, \code{\LinkA{mutate}{mutate}}, \code{\LinkA{mutate\_}{mutate.Rul.}}, \code{\LinkA{rename}{rename}}, \code{\LinkA{rename\_}{rename.Rul.}}, \code{\LinkA{select}{select}}, \code{\LinkA{select\_}{select.Rul.}}, \code{\LinkA{slice}{slice}}, \code{\LinkA{slice\_}{slice.Rul.}}, \code{\LinkA{summarise}{summarise}}, \code{\LinkA{summarise\_}{summarise.Rul.}}, \code{\LinkA{transmute}{transmute}}, \code{\LinkA{transmute\_}{transmute.Rul.}}, \code{\LinkA{ungroup}{ungroup}} \item[magrittr] \code{\LinkA{\Rpercent{}>\Rpercent{}}{.Rpcent.>.Rpcent.}} \end{description}" +filter,plotly,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[dplyr] \code{\LinkA{arrange}{arrange}}, \code{\LinkA{arrange\_}{arrange.Rul.}}, \code{\LinkA{distinct}{distinct}}, \code{\LinkA{distinct\_}{distinct.Rul.}}, \code{\LinkA{do}{do}}, \code{\LinkA{do\_}{do.Rul.}}, \code{\LinkA{filter}{filter}}, \code{\LinkA{filter\_}{filter.Rul.}}, \code{\LinkA{group\_by}{group.Rul.by}}, \code{\LinkA{group\_by\_}{group.Rul.by.Rul.}}, \code{\LinkA{groups}{groups}}, \code{\LinkA{mutate}{mutate}}, \code{\LinkA{mutate\_}{mutate.Rul.}}, \code{\LinkA{rename}{rename}}, \code{\LinkA{rename\_}{rename.Rul.}}, \code{\LinkA{select}{select}}, \code{\LinkA{select\_}{select.Rul.}}, \code{\LinkA{slice}{slice}}, \code{\LinkA{slice\_}{slice.Rul.}}, \code{\LinkA{summarise}{summarise}}, \code{\LinkA{summarise\_}{summarise.Rul.}}, \code{\LinkA{transmute}{transmute}}, \code{\LinkA{transmute\_}{transmute.Rul.}}, \code{\LinkA{ungroup}{ungroup}} \item[magrittr] \code{\LinkA{\Rpercent{}>\Rpercent{}}{.Rpcent.>.Rpcent.}} \end{description}" +ggplotly,plotly,This function converts a \code{\LinkA{ggplot2::ggplot()}{ggplot2::ggplot()}} object to a plotly object. +group_by,plotly,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[dplyr] \code{\LinkA{arrange}{arrange}}, \code{\LinkA{arrange\_}{arrange.Rul.}}, \code{\LinkA{distinct}{distinct}}, \code{\LinkA{distinct\_}{distinct.Rul.}}, \code{\LinkA{do}{do}}, \code{\LinkA{do\_}{do.Rul.}}, \code{\LinkA{filter}{filter}}, \code{\LinkA{filter\_}{filter.Rul.}}, \code{\LinkA{group\_by}{group.Rul.by}}, \code{\LinkA{group\_by\_}{group.Rul.by.Rul.}}, \code{\LinkA{groups}{groups}}, \code{\LinkA{mutate}{mutate}}, \code{\LinkA{mutate\_}{mutate.Rul.}}, \code{\LinkA{rename}{rename}}, \code{\LinkA{rename\_}{rename.Rul.}}, \code{\LinkA{select}{select}}, \code{\LinkA{select\_}{select.Rul.}}, \code{\LinkA{slice}{slice}}, \code{\LinkA{slice\_}{slice.Rul.}}, \code{\LinkA{summarise}{summarise}}, \code{\LinkA{summarise\_}{summarise.Rul.}}, \code{\LinkA{transmute}{transmute}}, \code{\LinkA{transmute\_}{transmute.Rul.}}, \code{\LinkA{ungroup}{ungroup}} \item[magrittr] \code{\LinkA{\Rpercent{}>\Rpercent{}}{.Rpcent.>.Rpcent.}} \end{description}" +mutate,plotly,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[dplyr] \code{\LinkA{arrange}{arrange}}, \code{\LinkA{arrange\_}{arrange.Rul.}}, \code{\LinkA{distinct}{distinct}}, \code{\LinkA{distinct\_}{distinct.Rul.}}, \code{\LinkA{do}{do}}, \code{\LinkA{do\_}{do.Rul.}}, \code{\LinkA{filter}{filter}}, \code{\LinkA{filter\_}{filter.Rul.}}, \code{\LinkA{group\_by}{group.Rul.by}}, \code{\LinkA{group\_by\_}{group.Rul.by.Rul.}}, \code{\LinkA{groups}{groups}}, \code{\LinkA{mutate}{mutate}}, \code{\LinkA{mutate\_}{mutate.Rul.}}, \code{\LinkA{rename}{rename}}, \code{\LinkA{rename\_}{rename.Rul.}}, \code{\LinkA{select}{select}}, \code{\LinkA{select\_}{select.Rul.}}, \code{\LinkA{slice}{slice}}, \code{\LinkA{slice\_}{slice.Rul.}}, \code{\LinkA{summarise}{summarise}}, \code{\LinkA{summarise\_}{summarise.Rul.}}, \code{\LinkA{transmute}{transmute}}, \code{\LinkA{transmute\_}{transmute.Rul.}}, \code{\LinkA{ungroup}{ungroup}} \item[magrittr] \code{\LinkA{\Rpercent{}>\Rpercent{}}{.Rpcent.>.Rpcent.}} \end{description}" +rename,plotly,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[dplyr] \code{\LinkA{arrange}{arrange}}, \code{\LinkA{arrange\_}{arrange.Rul.}}, \code{\LinkA{distinct}{distinct}}, \code{\LinkA{distinct\_}{distinct.Rul.}}, \code{\LinkA{do}{do}}, \code{\LinkA{do\_}{do.Rul.}}, \code{\LinkA{filter}{filter}}, \code{\LinkA{filter\_}{filter.Rul.}}, \code{\LinkA{group\_by}{group.Rul.by}}, \code{\LinkA{group\_by\_}{group.Rul.by.Rul.}}, \code{\LinkA{groups}{groups}}, \code{\LinkA{mutate}{mutate}}, \code{\LinkA{mutate\_}{mutate.Rul.}}, \code{\LinkA{rename}{rename}}, \code{\LinkA{rename\_}{rename.Rul.}}, \code{\LinkA{select}{select}}, \code{\LinkA{select\_}{select.Rul.}}, \code{\LinkA{slice}{slice}}, \code{\LinkA{slice\_}{slice.Rul.}}, \code{\LinkA{summarise}{summarise}}, \code{\LinkA{summarise\_}{summarise.Rul.}}, \code{\LinkA{transmute}{transmute}}, \code{\LinkA{transmute\_}{transmute.Rul.}}, \code{\LinkA{ungroup}{ungroup}} \item[magrittr] \code{\LinkA{\Rpercent{}>\Rpercent{}}{.Rpcent.>.Rpcent.}} \end{description}" +select,plotly,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[dplyr] \code{\LinkA{arrange}{arrange}}, \code{\LinkA{arrange\_}{arrange.Rul.}}, \code{\LinkA{distinct}{distinct}}, \code{\LinkA{distinct\_}{distinct.Rul.}}, \code{\LinkA{do}{do}}, \code{\LinkA{do\_}{do.Rul.}}, \code{\LinkA{filter}{filter}}, \code{\LinkA{filter\_}{filter.Rul.}}, \code{\LinkA{group\_by}{group.Rul.by}}, \code{\LinkA{group\_by\_}{group.Rul.by.Rul.}}, \code{\LinkA{groups}{groups}}, \code{\LinkA{mutate}{mutate}}, \code{\LinkA{mutate\_}{mutate.Rul.}}, \code{\LinkA{rename}{rename}}, \code{\LinkA{rename\_}{rename.Rul.}}, \code{\LinkA{select}{select}}, \code{\LinkA{select\_}{select.Rul.}}, \code{\LinkA{slice}{slice}}, \code{\LinkA{slice\_}{slice.Rul.}}, \code{\LinkA{summarise}{summarise}}, \code{\LinkA{summarise\_}{summarise.Rul.}}, \code{\LinkA{transmute}{transmute}}, \code{\LinkA{transmute\_}{transmute.Rul.}}, \code{\LinkA{ungroup}{ungroup}} \item[magrittr] \code{\LinkA{\Rpercent{}>\Rpercent{}}{.Rpcent.>.Rpcent.}} \end{description}" +summarise,plotly,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[dplyr] \code{\LinkA{arrange}{arrange}}, \code{\LinkA{arrange\_}{arrange.Rul.}}, \code{\LinkA{distinct}{distinct}}, \code{\LinkA{distinct\_}{distinct.Rul.}}, \code{\LinkA{do}{do}}, \code{\LinkA{do\_}{do.Rul.}}, \code{\LinkA{filter}{filter}}, \code{\LinkA{filter\_}{filter.Rul.}}, \code{\LinkA{group\_by}{group.Rul.by}}, \code{\LinkA{group\_by\_}{group.Rul.by.Rul.}}, \code{\LinkA{groups}{groups}}, \code{\LinkA{mutate}{mutate}}, \code{\LinkA{mutate\_}{mutate.Rul.}}, \code{\LinkA{rename}{rename}}, \code{\LinkA{rename\_}{rename.Rul.}}, \code{\LinkA{select}{select}}, \code{\LinkA{select\_}{select.Rul.}}, \code{\LinkA{slice}{slice}}, \code{\LinkA{slice\_}{slice.Rul.}}, \code{\LinkA{summarise}{summarise}}, \code{\LinkA{summarise\_}{summarise.Rul.}}, \code{\LinkA{transmute}{transmute}}, \code{\LinkA{transmute\_}{transmute.Rul.}}, \code{\LinkA{ungroup}{ungroup}} \item[magrittr] \code{\LinkA{\Rpercent{}>\Rpercent{}}{.Rpcent.>.Rpcent.}} \end{description}" +transmute,plotly,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[dplyr] \code{\LinkA{arrange}{arrange}}, \code{\LinkA{arrange\_}{arrange.Rul.}}, \code{\LinkA{distinct}{distinct}}, \code{\LinkA{distinct\_}{distinct.Rul.}}, \code{\LinkA{do}{do}}, \code{\LinkA{do\_}{do.Rul.}}, \code{\LinkA{filter}{filter}}, \code{\LinkA{filter\_}{filter.Rul.}}, \code{\LinkA{group\_by}{group.Rul.by}}, \code{\LinkA{group\_by\_}{group.Rul.by.Rul.}}, \code{\LinkA{groups}{groups}}, \code{\LinkA{mutate}{mutate}}, \code{\LinkA{mutate\_}{mutate.Rul.}}, \code{\LinkA{rename}{rename}}, \code{\LinkA{rename\_}{rename.Rul.}}, \code{\LinkA{select}{select}}, \code{\LinkA{select\_}{select.Rul.}}, \code{\LinkA{slice}{slice}}, \code{\LinkA{slice\_}{slice.Rul.}}, \code{\LinkA{summarise}{summarise}}, \code{\LinkA{summarise\_}{summarise.Rul.}}, \code{\LinkA{transmute}{transmute}}, \code{\LinkA{transmute\_}{transmute.Rul.}}, \code{\LinkA{ungroup}{ungroup}} \item[magrittr] \code{\LinkA{\Rpercent{}>\Rpercent{}}{.Rpcent.>.Rpcent.}} \end{description}" +read_csv,readr,"\code{read\_csv()} and \code{read\_tsv()} are special cases of the more general \code{read\_delim()}. They're useful for reading the most common types of flat file data, comma separated values and tab separated values, respectively. \code{read\_csv2()} uses \AsIs{\texttt{;}} for the field separator and \AsIs{\texttt{,}} for the decimal point. This format is common in some European countries." +read_delim,readr,"\code{read\_csv()} and \code{read\_tsv()} are special cases of the more general \code{read\_delim()}. They're useful for reading the most common types of flat file data, comma separated values and tab separated values, respectively. \code{read\_csv2()} uses \AsIs{\texttt{;}} for the field separator and \AsIs{\texttt{,}} for the decimal point. This format is common in some European countries." +read_rds,readr,Consistent wrapper around \code{\LinkA{saveRDS()}{saveRDS}} and \code{\LinkA{readRDS()}{readRDS}}. \code{write\_rds()} does not compress by default as space is generally cheaper than time. +read_tsv,readr,"\code{read\_csv()} and \code{read\_tsv()} are special cases of the more general \code{read\_delim()}. They're useful for reading the most common types of flat file data, comma separated values and tab separated values, respectively. \code{read\_csv2()} uses \AsIs{\texttt{;}} for the field separator and \AsIs{\texttt{,}} for the decimal point. This format is common in some European countries." +write_csv,readr,"The \AsIs{\texttt{write\_*()}} family of functions are an improvement to analogous function such as \code{\LinkA{write.csv()}{write.csv}} because they are approximately twice as fast. Unlike \code{\LinkA{write.csv()}{write.csv}}, these functions do not include row names as a column in the written file. A generic function, \code{output\_column()}, is applied to each variable to coerce columns to suitable output." +write_rds,readr,Consistent wrapper around \code{\LinkA{saveRDS()}{saveRDS}} and \code{\LinkA{readRDS()}{readRDS}}. \code{write\_rds()} does not compress by default as space is generally cheaper than time. +read_excel,readxl,"Read xls and xlsx files \code{read\_excel()} calls \code{\LinkA{excel\_format()}{excel.Rul.format}} to determine if \code{path} is xls or xlsx, based on the file extension and the file itself, in that order. Use \code{read\_xls()} and \code{read\_xlsx()} directly if you know better and want to prevent such guessing." +percent,scales,\strong{[Superseded]} These functions are kept for backward compatibility; you should switch to \code{\LinkA{label\_percent()}{label.Rul.percent}} for new code. +binomial,stats,Family objects provide a convenient way to specify the details of the models used by functions such as \code{\LinkA{glm}{glm}}. See the documentation for \code{\LinkA{glm}{glm}} for the details on how such model fitting takes place. +coef,stats,\code{coef} is a generic function which extracts model coefficients from objects returned by modeling functions. \code{coefficients} is an \emph{alias} for it. +cor,stats,"\code{var}, \code{cov} and \code{cor} compute the variance of \code{x} and the covariance or correlation of \code{x} and \code{y} if these are vectors. If \code{x} and \code{y} are matrices then the covariances (or correlations) between the columns of \code{x} and the columns of \code{y} are computed. \code{cov2cor} scales a covariance matrix into the corresponding correlation matrix \emph{efficiently}." +cor.test,stats,"Test for association between paired samples, using one of Pearson's product moment correlation coefficient, Kendall's \eqn{\tau}{} or Spearman's \eqn{\rho}{}." +filter,stats,Applies linear filtering to a univariate time series or to each series separately of a multivariate time series. +glm,stats,"\code{glm} is used to fit generalized linear models, specified by giving a symbolic description of the linear predictor and a description of the error distribution." +lm,stats,"\code{lm} is used to fit linear models, including multivariate ones. It can be used to carry out regression, single stratum analysis of variance and analysis of covariance (although \code{\LinkA{aov}{aov}} may provide a more convenient interface for these)." +median,stats,Compute the sample median. +p.adjust,stats,"Given a set of p-values, returns p-values adjusted using one of several methods." +t.test,stats,Performs one and two sample t-tests on vectors of data. +fixed,stringr,Modifier functions control the meaning of the \code{pattern} argument to stringr functions: \begin{itemize} \item{} \code{boundary()}: Match boundaries between things. \item{} \code{coll()}: Compare strings using standard Unicode collation rules. \item{} \code{fixed()}: Compare literal bytes. \item{} \code{regex()} (the default): Uses ICU regular expressions. \end{itemize} +str_detect,stringr,"\code{str\_detect()} returns a logical vector with \code{TRUE} for each element of \code{string} that matches \code{pattern} and \code{FALSE} otherwise. It's equivalent to \code{grepl(pattern, string)}." +str_extract,stringr,"\code{str\_extract()} extracts the first complete match from each string, \code{str\_extract\_all()}extracts all matches from each string." +str_extract_all,stringr,"\code{str\_extract()} extracts the first complete match from each string, \code{str\_extract\_all()}extracts all matches from each string." +str_remove,stringr,"Remove matches, i.e. replace them with \code{""""}." +str_replace,stringr,\code{str\_replace()} replaces the first match; \code{str\_replace\_all()} replaces all matches. +str_replace_all,stringr,\code{str\_replace()} replaces the first match; \code{str\_replace\_all()} replaces all matches. +str_split,stringr,"This family of functions provides various ways of splitting a string up into pieces. These two functions return a character vector: \begin{itemize} \item{} \code{str\_split\_1()} takes a single string and splits it into pieces, returning a single character vector. \item{} \code{str\_split\_i()} splits each string in a character vector into pieces and extracts the \code{i}th value, returning a character vector. \end{itemize} These two functions return a more complex object: \begin{itemize} \item{} \code{str\_split()} splits each string in a character vector into a varying number of pieces, returning a list of character vectors. \item{} \code{str\_split\_fixed()} splits each string in a character vector into a fixed number of pieces, returning a character matrix. \end{itemize} " +str_sub,stringr,\code{str\_sub()} extracts or replaces the elements at a single position in each string. \code{str\_sub\_all()} allows you to extract strings at multiple elements in every string. +str_subset,stringr,"\code{str\_subset()} returns all elements of \code{string} where there's at least one match to \code{pattern}. It's a wrapper around \code{x[str\_detect(x, pattern)]}, and is equivalent to \code{grep(pattern, x, value = TRUE)}. Use \code{\LinkA{str\_extract()}{str.Rul.extract}} to find the location of the match \emph{within} each string." +glimpse,tibble,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[magrittr] \code{\LinkA{\Rpercent{}>\Rpercent{}}{.Rpcent.>.Rpcent.}} \item[pillar] \code{\LinkA{glimpse}{glimpse}}, \code{\LinkA{obj\_sum}{obj.Rul.sum}}, \code{\LinkA{size\_sum}{size.Rul.sum}}, \code{\LinkA{tbl\_sum}{tbl.Rul.sum}}, \code{\LinkA{type\_sum}{type.Rul.sum}} \item[rlang] \code{\LinkA{has\_name}{has.Rul.name}} \end{description}" +rownames_to_column,tibble,"While a tibble can have row names (e.g., when converting from a regular data frame), they are removed when subsetting with the \code{[} operator. A warning will be raised when attempting to assign non-\code{NULL} row names to a tibble. Generally, it is best to avoid row names, because they are basically a character column with different semantics than every other column. These functions allow to you detect if a data frame has row names (\code{has\_rownames()}), remove them (\code{remove\_rownames()}), or convert them back-and-forth between an explicit column (\code{rownames\_to\_column()} and \code{column\_to\_rownames()}). Also included is \code{rowid\_to\_column()}, which adds a column at the start of the dataframe of ascending sequential row ids starting at 1. Note that this will remove any existing row names." +tibble,tibble,"\code{tibble()} constructs a data frame. It is used like \code{\LinkA{base::data.frame()}{base::data.frame()}}, but with a couple notable differences: \begin{itemize} \item{} The returned data frame has the class \code{\LinkA{tbl\_df}{tbl.Rul.df.Rdash.class}}, in addition to \code{data.frame}. This allows so-called ""tibbles"" to exhibit some special behaviour, such as \LinkA{enhanced printing}{formatting}. Tibbles are fully described in \code{\LinkA{tbl\_df}{tbl.Rul.df.Rdash.class}}. \item{} \code{tibble()} is much lazier than \code{\LinkA{base::data.frame()}{base::data.frame()}} in terms of transforming the user's input. \begin{itemize} \item{} Character vectors are not coerced to factor. \item{} List-columns are expressly anticipated and do not require special tricks. \item{} Column names are not modified. \item{} Inner names in columns are left unchanged. \end{itemize} \item{} \code{tibble()} builds columns sequentially. When defining a column, you can refer to columns created earlier in the call. Only columns of length one are recycled. \item{} If a column evaluates to a data frame or tibble, it is nested or spliced. If it evaluates to a matrix or a array, it remains a matrix or array, respectively. See examples. \end{itemize} \code{tibble\_row()} constructs a data frame that is guaranteed to occupy one row. Vector columns are required to have size one, non-vector columns are wrapped in a list." +anti_join,tidylog,Wrapper around dplyr::anti\_join that prints information about the operation +count,tidylog,Wrapper around dplyr::count that prints information about the operation +distinct,tidylog,Wrapper around dplyr::distinct that prints information about the operation +drop_na,tidylog,Wrapper around tidyr::drop\_na that prints information about the operation +filter,tidylog,Wrapper around dplyr::filter that prints information about the operation +full_join,tidylog,Wrapper around dplyr::full\_join that prints information about the operation +group_by,tidylog,Wrapper around dplyr::group\_by that prints information about the operation +inner_join,tidylog,Wrapper around dplyr::inner\_join that prints information about the operation +left_join,tidylog,Wrapper around dplyr::left\_join that prints information about the operation +mutate,tidylog,Wrapper around dplyr::mutate that prints information about the operation +pivot_longer,tidylog,Wrapper around tidyr::pivot\_longer that prints information about the operation +pivot_wider,tidylog,Wrapper around tidyr::pivot\_wider that prints information about the operation +relocate,tidylog,Wrapper around dplyr::relocate that prints information about the operation +rename,tidylog,Wrapper around dplyr::rename that prints information about the operation +rename_with,tidylog,Wrapper around dplyr::rename\_with that prints information about the operation +replace_na,tidylog,Wrapper around tidyr::replace\_na that prints information about the operation +right_join,tidylog,Wrapper around dplyr::right\_join that prints information about the operation +select,tidylog,Wrapper around dplyr::select that prints information about the operation +slice_sample,tidylog,Wrapper around dplyr::slice\_sample that prints information about the operation +summarise,tidylog,Wrapper around dplyr::summarise that prints information about the operation +summarize,tidylog,Wrapper around dplyr::summarize that prints information about the operation +tally,tidylog,Wrapper around dplyr::tally that prints information about the operation +transmute,tidylog,Wrapper around dplyr::transmute that prints information about the operation +contains,tidyr,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[tibble] \code{\LinkA{as\_tibble}{as.Rul.tibble}}, \code{\LinkA{tibble}{tibble}}, \code{\LinkA{tribble}{tribble}} \item[tidyselect] \code{\LinkA{all\_of}{all.Rul.of}}, \code{\LinkA{any\_of}{any.Rul.of}}, \code{\LinkA{contains}{contains}}, \code{\LinkA{ends\_with}{ends.Rul.with}}, \code{\LinkA{everything}{everything}}, \code{\LinkA{last\_col}{last.Rul.col}}, \code{\LinkA{matches}{matches}}, \code{\LinkA{num\_range}{num.Rul.range}}, \code{\LinkA{one\_of}{one.Rul.of}}, \code{\LinkA{starts\_with}{starts.Rul.with}} \end{description}" +drop_na,tidyr,\code{drop\_na()} drops rows where any column specified by \code{...} contains a missing value. +ends_with,tidyr,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[tibble] \code{\LinkA{as\_tibble}{as.Rul.tibble}}, \code{\LinkA{tibble}{tibble}}, \code{\LinkA{tribble}{tribble}} \item[tidyselect] \code{\LinkA{all\_of}{all.Rul.of}}, \code{\LinkA{any\_of}{any.Rul.of}}, \code{\LinkA{contains}{contains}}, \code{\LinkA{ends\_with}{ends.Rul.with}}, \code{\LinkA{everything}{everything}}, \code{\LinkA{last\_col}{last.Rul.col}}, \code{\LinkA{matches}{matches}}, \code{\LinkA{num\_range}{num.Rul.range}}, \code{\LinkA{one\_of}{one.Rul.of}}, \code{\LinkA{starts\_with}{starts.Rul.with}} \end{description}" +everything,tidyr,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[tibble] \code{\LinkA{as\_tibble}{as.Rul.tibble}}, \code{\LinkA{tibble}{tibble}}, \code{\LinkA{tribble}{tribble}} \item[tidyselect] \code{\LinkA{all\_of}{all.Rul.of}}, \code{\LinkA{any\_of}{any.Rul.of}}, \code{\LinkA{contains}{contains}}, \code{\LinkA{ends\_with}{ends.Rul.with}}, \code{\LinkA{everything}{everything}}, \code{\LinkA{last\_col}{last.Rul.col}}, \code{\LinkA{matches}{matches}}, \code{\LinkA{num\_range}{num.Rul.range}}, \code{\LinkA{one\_of}{one.Rul.of}}, \code{\LinkA{starts\_with}{starts.Rul.with}} \end{description}" +one_of,tidyr,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[tibble] \code{\LinkA{as\_tibble}{as.Rul.tibble}}, \code{\LinkA{tibble}{tibble}}, \code{\LinkA{tribble}{tribble}} \item[tidyselect] \code{\LinkA{all\_of}{all.Rul.of}}, \code{\LinkA{any\_of}{any.Rul.of}}, \code{\LinkA{contains}{contains}}, \code{\LinkA{ends\_with}{ends.Rul.with}}, \code{\LinkA{everything}{everything}}, \code{\LinkA{last\_col}{last.Rul.col}}, \code{\LinkA{matches}{matches}}, \code{\LinkA{num\_range}{num.Rul.range}}, \code{\LinkA{one\_of}{one.Rul.of}}, \code{\LinkA{starts\_with}{starts.Rul.with}} \end{description}" +pivot_longer,tidyr,"\code{pivot\_longer()} ""lengthens"" data, increasing the number of rows and decreasing the number of columns. The inverse transformation is \code{\LinkA{pivot\_wider()}{pivot.Rul.wider}} Learn more in \code{vignette(""pivot"")}." +pivot_wider,tidyr,"\code{pivot\_wider()} ""widens"" data, increasing the number of columns and decreasing the number of rows. The inverse transformation is \code{\LinkA{pivot\_longer()}{pivot.Rul.longer}}. Learn more in \code{vignette(""pivot"")}." +replace_na,tidyr,Replace NAs with specified values +separate,tidyr,"\strong{[Superseded]} \code{separate()} has been superseded in favour of \code{\LinkA{separate\_wider\_position()}{separate.Rul.wider.Rul.position}} and \code{\LinkA{separate\_wider\_delim()}{separate.Rul.wider.Rul.delim}} because the two functions make the two uses more obvious, the API is more polished, and the handling of problems is better. Superseded functions will not go away, but will only receive critical bug fixes. Given either a regular expression or a vector of character positions, \code{separate()} turns a single character column into multiple columns." +starts_with,tidyr,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[tibble] \code{\LinkA{as\_tibble}{as.Rul.tibble}}, \code{\LinkA{tibble}{tibble}}, \code{\LinkA{tribble}{tribble}} \item[tidyselect] \code{\LinkA{all\_of}{all.Rul.of}}, \code{\LinkA{any\_of}{any.Rul.of}}, \code{\LinkA{contains}{contains}}, \code{\LinkA{ends\_with}{ends.Rul.with}}, \code{\LinkA{everything}{everything}}, \code{\LinkA{last\_col}{last.Rul.col}}, \code{\LinkA{matches}{matches}}, \code{\LinkA{num\_range}{num.Rul.range}}, \code{\LinkA{one\_of}{one.Rul.of}}, \code{\LinkA{starts\_with}{starts.Rul.with}} \end{description}" +tibble,tidyr,"These objects are imported from other packages. Follow the links below to see their documentation. \begin{description} \item[tibble] \code{\LinkA{as\_tibble}{as.Rul.tibble}}, \code{\LinkA{tibble}{tibble}}, \code{\LinkA{tribble}{tribble}} \item[tidyselect] \code{\LinkA{all\_of}{all.Rul.of}}, \code{\LinkA{any\_of}{any.Rul.of}}, \code{\LinkA{contains}{contains}}, \code{\LinkA{ends\_with}{ends.Rul.with}}, \code{\LinkA{everything}{everything}}, \code{\LinkA{last\_col}{last.Rul.col}}, \code{\LinkA{matches}{matches}}, \code{\LinkA{num\_range}{num.Rul.range}}, \code{\LinkA{one\_of}{one.Rul.of}}, \code{\LinkA{starts\_with}{starts.Rul.with}} \end{description}" +unite,tidyr,Convenience function to paste together multiple columns into one. +data,utils,"Loads specified data sets, or list the available data sets." +download.file,utils,This function can be used to download a file from the Internet. +head,utils,"Returns the first or last parts of a vector, matrix, table, data frame or function. Since \code{head()} and \code{tail()} are generic functions, they may also have been extended to other classes." +install.packages,utils,Download and install packages from CRAN-like repositories or from local files. +sessionInfo,utils,"Get and report version information about \R{}, the OS and attached or loaded packages. The \code{\LinkA{print}{print}()} and \code{\LinkA{toLatex}{toLatex}()} methods (for a \code{""sessionInfo""} object) show the locale and timezone information by default, when \code{locale} or \code{tzone} are true. The \code{system.codepage} is only shown when it is not empty, i.e., only on Windows, \emph{and} if it differs from \code{code.page}, see below or \code{\LinkA{l10n\_info}{l10n.Rul.info}()}." +str,utils,"Compactly display the internal \bold{str}ucture of an \R{} object, a diagnostic function and an alternative to \code{\LinkA{summary}{summary}} (and to some extent, \code{\LinkA{dput}{dput}}). Ideally, only one line for each `basic' structure is displayed. It is especially well suited to compactly display the (abbreviated) contents of (possibly nested) lists. The idea is to give reasonable output for \bold{any} \R{} object. It calls \code{\LinkA{args}{args}} for (non-primitive) function objects. \code{strOptions()} is a convenience function for setting \code{\LinkA{options}{options}(str = .)}, see the examples." +tail,utils,"Returns the first or last parts of a vector, matrix, table, data frame or function. Since \code{head()} and \code{tail()} are generic functions, they may also have been extended to other classes." diff --git a/resources/raw_all_func_forpuzzles.rds b/resources/raw_all_func_forpuzzles.rds new file mode 100644 index 00000000..64faabc3 Binary files /dev/null and b/resources/raw_all_func_forpuzzles.rds differ diff --git a/scripts/list_all_packages.R b/scripts/list_all_packages.R index 0eb2192a..b2c6bfa9 100644 --- a/scripts/list_all_packages.R +++ b/scripts/list_all_packages.R @@ -6,12 +6,12 @@ ss = function(x,pattern,slot=1,...) { } ## find RMDs -files <- dir(pattern = '[.]R', recursive = TRUE) -files = files[ !grepl("scratch", files)] -files = files[ !grepl("all_packages", files)] +files <- dir(pattern = '[.]Rmd', recursive = TRUE) + +files = files[ grepl("modules", files)] # files = files[ files != "index.Rmd" ] # files = files[ !grepl("HW", files)] -files = files[ basename(files) != "illusion.Rmd" ] +#files = files[ basename(files) != "illusion.Rmd" ] ## read in code fileList = lapply(files, scan, what = "character()", sep="\n") @@ -19,12 +19,13 @@ allFiles = unlist(fileList) allFiles = trimws(allFiles) libCalls = allFiles[grep("^(library|require)", allFiles)] theLibs = ss(ss(libCalls, "(", 2, fixed = TRUE), ")", fixed=TRUE) -theLibs = ss(theLibs, ",", 1, fixed = TRUE) -theLibs = ss(theLibs, '"', 1, fixed = TRUE) -theLibs = ss(theLibs, " ", 1, fixed = TRUE) +#theLibs = ss(theLibs, ",", 1, fixed = TRUE) +#theLibs = ss(theLibs, '"', 1, fixed = TRUE) +#theLibs = ss(theLibs, " ", 1, fixed = TRUE) theLibs = unique(theLibs) theLibs = sort(theLibs) - +theLibs = theLibs[ !grepl("replace_with_package_name", theLibs)] +theLibs = theLibs[ !grepl("ThemePark|ottrpal", theLibs)] writeLines(theLibs, con = "./resources/all_the_packages.txt") sapply(theLibs, library, character.only = TRUE) @@ -33,12 +34,39 @@ sapply(theLibs, library, character.only = TRUE) # Getting functions for cheatsheet #################################### library(NCmisc) -all_r = list.files(pattern = "[.]R$", recursive = TRUE, full.names = TRUE) -all_r = all_r[ !grepl("scratch", all_r)] -all_r = all_r[ !grepl("all_packages", all_r)] -xall_func = all_func = sapply(all_r, list.functions.in.file) +library(filestrings) +all_rmd = list.files(pattern = "[.]Rmd", recursive = TRUE, full.names = TRUE) +#all_r = all_r[ !grepl("scratch", all_r)] +#all_r = all_r[ !grepl("all_packages", all_r)] +all_rmd = all_rmd[ grepl("modules", all_rmd)] # get just just module files +dir.create("modules/R_files") + +#####If not copying files +sapply(all_rmd, knitr::purl) # create R file from Rmd files +all_r_files = list.files(pattern = "[.]R", recursive = FALSE, full.names = TRUE) #get new R file names +new_r_files <-gsub(pattern = "./", replacement = "./modules/R_files/", all_r_files) #change path name +# make df for file destination +df = data.frame( + source = all_r_files, + destination = (new_r_files)) +file.rename(from = df$source, to = file.path(df$destination)) # move files + +new_r_files = new_r_files[ !grepl("Basic_R.R", new_r_files)] # remove one problematic file - with errors on purpose +all_func = sapply(new_r_files, list.functions.in.file) + +write_rds(all_func, file = "resources/raw_all_func_forpuzzles.rds") +#### if copying files +#file.copy(all_rmd, to = "modules/R_files") # copy to new R_files dir +#new_r_files <-gsub(pattern = "./", replacement = "./modules/R_files/", all_r_files) +#all_rmd = list.files(path = "modules/R_files", full.names = TRUE) # new file names with paths +#sapply(all_rmd, knitr::purl) # create R file from Rmd files +#all_r_files = list.files(pattern = "[.]R", recursive = FALSE, full.names = TRUE) + +readr::write_csv(all_func, file = "./resources/all_the_functions.csv") + + + -all_func = xall_func quick = function(r) { res = mapply(function(x, y) { x[ !grepl(":", x)] = ""