Package autocogs. September 22, Title Automatic Cognostic Summaries Version 0.1.1

Similar documents
Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package spark. July 21, 2017

Package ggimage. R topics documented: December 5, Title Use Image in 'ggplot2' Version 0.1.0

Package ggimage. R topics documented: November 1, Title Use Image in 'ggplot2' Version 0.0.7

Package fastdummies. January 8, 2018

Package harrypotter. September 3, 2018

Package crossword.r. January 19, 2018

Package datasets.load

Package qualmap. R topics documented: September 12, Type Package

Package messaging. May 27, 2018

Package tidyimpute. March 5, 2018

Package gameofthrones

Package gggenes. R topics documented: November 7, Title Draw Gene Arrow Maps in 'ggplot2' Version 0.3.2

Package docxtools. July 6, 2018

Package repec. August 31, 2018

Package WordR. September 7, 2017

Package projector. February 27, 2018

Package vinereg. August 10, 2018

Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package canvasxpress

Package nima. May 23, 2018

Package vip. June 15, 2018

Package ggextra. April 4, 2018

Package geogrid. August 19, 2018

Package available. November 17, 2017

Package linkspotter. July 22, Type Package

Package kdtools. April 26, 2018

Package bigreadr. R topics documented: August 13, Version Date Title Read Large Text Files

Package keyholder. May 19, 2018

Package ecoseries. R topics documented: September 27, 2017

Package bisect. April 16, 2018

Package jpmesh. December 4, 2017

Package robotstxt. November 12, 2017

Package sessioninfo. June 21, 2017

Package QCAtools. January 3, 2017

Package FSelectorRcpp

Package widyr. August 14, 2017

Package splithalf. March 17, 2018

Package balance. October 12, 2018

Package rsppfp. November 20, 2018

Package slickr. March 6, 2018

Package quickreg. R topics documented:

Package sigqc. June 13, 2018

Package dbx. July 5, 2018

Package fastqcr. April 11, 2017

Package goodpractice

Package sfdct. August 29, 2017

Package tidylpa. March 28, 2018

Package sankey. R topics documented: October 22, 2017

Package catenary. May 4, 2018

Package clipr. June 23, 2018

Package mason. July 5, 2018

Package queuecomputer

Package pwrab. R topics documented: June 6, Type Package Title Power Analysis for AB Testing Version 0.1.0

Package comparedf. February 11, 2019

Package datapasta. January 24, 2018

Package ECctmc. May 1, 2018

Package embed. November 19, 2018

Package mdftracks. February 6, 2017

Intro to R for Epidemiologists

Package glue. March 12, 2019

Package validara. October 19, 2017

Package d3plus. September 25, 2017

Package superheat. February 4, 2017

Package colf. October 9, 2017

Package sure. September 19, 2017

Package tibble. August 22, 2017

Package oec. R topics documented: May 11, Type Package

Package infer. July 11, Type Package Title Tidy Statistical Inference Version 0.3.0

Package climber. R topics documented:

Package PCADSC. April 19, 2017

Package palettetown. April 7, 2016

Package knitrprogressbar

Package editdata. October 7, 2017

Package kirby21.base

Package statsdk. September 30, 2017

Package humanize. R topics documented: April 4, Version Title Create Values for Human Consumption

Package gtrendsr. August 4, 2018

Package farver. November 20, 2018

Package ecotox. June 28, 2018

Package darksky. September 20, 2017

Package dkanr. July 12, 2018

Package anomalize. April 17, 2018

Package gtrendsr. October 19, 2017

Package narray. January 28, 2018

Package loggit. April 9, 2018

Package barcoder. October 26, 2018

Package postal. July 27, 2018

Package strat. November 23, 2016

Package jstree. October 24, 2017

Package pdfsearch. July 10, 2018

Package sfc. August 29, 2016

Package cli. November 5, 2017

Package githubinstall

Package readobj. November 2, 2017

Package lvplot. August 29, 2016

Package readxl. April 18, 2017

Package weco. May 4, 2018

Package ggdark. R topics documented: January 11, Type Package Title Dark Mode for 'ggplot2' Themes Version Author Neal Grantham

Package wikitaxa. December 21, 2017

Transcription:

Title Automatic Cognostic Summaries Version 0.1.1 Package autocogs September 22, 2018 Automatically calculates cognostic groups for plot objects and list column plot objects. Results are returned in a nested data frame. Depends R (>= 3.4.0) License MIT + file LICENSE Encoding UTF-8 LazyData true Imports dplyr, checkmate, MASS, broom, moments, diptest, mclust, ggplot2, tibble, utils, hexbin, progress RoxygenNote 6.1.0 Collate 'autocog.r' 'known_cog_groups.r' 'add_cog_group.r' 'field_info.r' 'add_cog_group_.r' 'known_layer_cogs.r' 'add_layer_cogs.r' 'add_layer_cogs_.r' 'cog_desc.r' 'cog_spec.r' 'layer_count.r' 'layer_info.r' 'of_type.r' 'plot_class.r' 'plot_cogs.r' Suggests testthat, covr URL https://github.com/schloerke/autocogs BugReports https://github.com/schloerke/autocogs/issues NeedsCompilation no Author Barret Schloerke [aut], Ryan Hafen [ths, cre] Maintainer Ryan Hafen <rhafen@gmail.com> Repository CRAN Date/Publication 2018-09-21 22:30:13 UTC 1

2 add_cog_group R topics documented: add_cog_group....................................... 2 add_layer_cogs....................................... 3 autocog........................................... 3 autocog_........................................... 4 cog_desc.......................................... 5 cog_group.......................................... 5 cog_spec.......................................... 6 field_info.......................................... 7 known_cog_groups..................................... 8 known_layer_cogs..................................... 8 layer_count......................................... 8 layer_info.......................................... 9 panel_cogs......................................... 10 plot_class.......................................... 10 Index 12 add_cog_group Add a cognostic group Add a new cognostic to be used when calculating automatic cognostics. add_cog_group(name, fields, description = NA, fn,...) name fields description fn... ignored Name of cognostic group data.frame of 'dimension' and 'type' columns. dplyr::bind_rows() of field_info outputs for convenience of cognostic group function to calculate a cognostic group. May return a named list or a single row tibble. Each value of the return data should be the output of cog_desc

add_layer_cogs 3 add_layer_cogs Add plot layer cognostics Add a new set of cognostic groups for a given plot layer. If the plot layer is found, the corresponding cognostic groups will be calculated. add_layer_cogs(name, description, cog_groups, kind = "ggplot",...) name Name of plot layer. This should match the output of the "name" values of layer_info description of cognostic group cog_groups A data.frame (or tibble) containing the columns: "cog_group", "cols", "name". "cog_group" column should contain a string value of a known cognostic group. "cols" should be a single value or vector of column names to use from the data supplied by layer_info during calculations. "name" should contain the final storage name of the cognostic group. kind String value that will match the output of plot_class of the desired plot object... ignored autocog Auto cognostic function Calculate an auto cognostic function given a name autocog(.name,...,.fn_only = FALSE).name name of a known cognostic... arguments passed onto the found function.fn_only boolean that determines if the function should be returned autocog("univariate_continuous", iris$sepal.length) fn <- autocog("univariate_continuous",.fn_only = TRUE) fn(iris$sepal.length)

4 autocog_ autocog_ Default Cognostic Group Functions These set of functions comprise the default cognostic groups. Each function produces it s own cognostic information given the required pieces of data. The functions print method will display the description. autocog_* functions will take the known_cog_groups() functions and format the output into a single row tibble. Any new known cognostic group function, NAME, will create a function called autocog_name, which may be called. Default Cognostic Group Functions: autocog_bivariate_continuous autocog_bivariate_counts autocog_bivariate_step autocog_boxplot autocog_density_2d_continuous autocog_density_continuous autocog_grouped_counts autocog_grouped_testing autocog_hex_counts autocog_histogram_counts autocog_linear_model autocog_loess_model autocog_pairwise_counts autocog_quantile_quantile autocog_scagnostics autocog_smooth_line autocog_square_counts autocog_univariate_continuous autocog_univariate_counts autocog_univariate_discrete x data that should appear on an x axis y data that should appear on an y axis... ignored direction step direction. Defaults to "hv" na.rm should NA points be removed when performing calculations h, n, bins, binwidth, clusters, bw, adjust, kernel, trim, group, groups, center, boundary, closed, p parameters usually set by corresponding "geoms" to be used within ggplot2 Stat* methods

cog_desc 5 See Also known_cog_groups() autocog_bivariate_continuous autocog_bivariate_continuous(iris$sepal.length, iris$sepal.width) cog_desc Cognostic Add a description to a cognostic (subset metric) cog_desc(x, desc = NULL) x desc univariate scalar description of x cog_desc(mean(1:10), "mean of 10 numbers") cog_group Cog group data frame Make a cog group data frame to be passed into add_layer_cogs cog_group(...)... sets of three values to fill in cog_group, cols, and name

6 cog_spec cog_group( "univariate_discrete", "x", "_x", "univariate_counts", "x", "_n" ) cog_group( "univariate_continuous", "x", "_x", "univariate_continuous", "y", "_y", "bivariate_continuous", c("x", "y"), "_bivar", "scagnostics", c("x", "y"), "_scagnostic", "bivariate_counts", c("x", "y"), "_n" ) cog_spec Cognostic Specification Cognostic Specification cog_spec(bivariate_continuous = TRUE, bivariate_counts = TRUE, bivariate_step = TRUE, boxplot = TRUE, density_2d_continuous = TRUE, density_continuous = TRUE, grouped_counts = TRUE, grouped_testing = TRUE, hex_counts = TRUE, histogram_counts = TRUE, linear_model = TRUE, loess_model = TRUE, pairwise_counts = TRUE, quantile_quantile = TRUE, scagnostics = TRUE, smooth_line = TRUE, square_counts = TRUE, univariate_continuous = TRUE, univariate_counts = TRUE, univariate_discrete = TRUE,...,.keep_layer = TRUE) as_cog_specs(p, specs) bivariate_continuous, bivariate_counts, bivariate_step, boxplot, density_2d_continuous, density_cont names of cognostic groups to calculate. The boolean value (TRUE) supplied to each argument determines if the value should be displayed if possible or removed if possible.... ignored. Will cause error if any are supplied.keep_layer p specs boolean (TRUE) that determines if the layer should be kept at all plot object in question list of cog_spec outputs for each layer of the plot object

field_info 7 Value cognostic specification that determines which cogs are added or removed if possible # example cog specifications # display like normal cog_spec(); TRUE # remove scagnostics cog_spec(scagnostics = FALSE) # remove layer cog_spec(.keep_layer = FALSE); FALSE # set up data p <- ggplot2::qplot(sepal.length, Sepal.Width, data = iris, geom = c("point", "smooth")) dt <- tibble::data_frame(panel = list(p)) # compute cognostics like normal add_panel_cogs(dt) # do not compute scagnostics for geom_point cognostics # compute geom_smooth cognostics add_panel_cogs(dt, spec = list(cog_spec(scagnostics = FALSE), TRUE)) # do not compute scagnostics for geom_point cognostics # do not compute geom_smooth cognostics add_panel_cogs(dt, spec = list(cog_spec(scagnostics = FALSE), FALSE)) field_info Field Type Information Field Type Information field_info(dimension = c("x", "y", "z", "group", "any"), type = c("continuous", "discrete", "date", "any")) dimension type field name. Use one of the listed options provided field type. Use one of the listed options provided

8 layer_count known_cog_groups Cognostic Group information To add more cognostic groups, please see add_cog_group() known_cog_groups() known_cog_groups() known_layer_cogs Layer Cognostic groups Display all layer cognostic information to be paired with information from known_cog_groups(). known_layer_cogs() known_layer_cogs() layer_count Plot layer count Retrieves the number of layers in a given plot layer_count(p) ## Default S3 method: layer_count(p) ## S3 method for class 'ggplot' layer_count(p)

layer_info 9 p plot object Value number library(ggplot2) p <- ggplot(iris, aes(sepal.length, Sepal.Width)) + geom_point() layer_count(p) # 1 layer_count(p + geom_smooth(method = "lm") + geom_density_2d()) # 3 layer_info Data List Data List layer_info(p, keep = TRUE,...) ## Default S3 method: layer_info(p, keep = TRUE,...) ## S3 method for class 'ggplot' layer_info(p, keep = TRUE,...) p keep plot object boolean vector (size = 1 or length(plot$layers)). Determines if that layer should have cognostics calculated... parameters passed on to corresponding layer_info require(ggplot2) p <- ggplot(iris, aes(sepal.length, Sepal.Width)) + geom_point(data = mpg, mapping = aes(cty, hwy)) layer_info(p)

10 plot_class panel_cogs Panel cognostics Return or concatenate panel cognostics. For each panel (plot) in the panel column, cognostics will be calculated for each panel. The result will be returned in a nested tibble. panel_cogs(dt, panel_col = "panel",...) add_panel_cogs(dt, panel_col = "panel",...) dt data to be used panel_col panel column to be used in dt... parameters passed to layer_info plot_class Plot class First class of the plot object. Exception is ggplot2 as many objects are of class gg plot_class(p) ## Default S3 method: plot_class(p) ## S3 method for class 'gg' plot_class(p) ## S3 method for class 'ggplot' plot_class(p) p plot object to retrieve class from

plot_class 11 library(ggplot2) p <- qplot(sepal.length, Sepal.Width, data = iris) plot_class(p)

Index add_cog_group, 2, 8 add_layer_cogs, 3, 5 add_panel_cogs (panel_cogs), 10 as_cog_specs (cog_spec), 6 autocog, 3 autocog_, 4 autocog_bivariate_continuous (autocog_), 4 autocog_bivariate_counts (autocog_), 4 autocog_bivariate_step (autocog_), 4 autocog_boxplot (autocog_), 4 autocog_density_2d_continuous (autocog_), 4 autocog_density_continuous (autocog_), 4 autocog_grouped_counts (autocog_), 4 autocog_grouped_testing (autocog_), 4 autocog_hex_counts (autocog_), 4 autocog_histogram_counts (autocog_), 4 autocog_linear_model (autocog_), 4 autocog_loess_model (autocog_), 4 autocog_pairwise_counts (autocog_), 4 autocog_quantile_quantile (autocog_), 4 autocog_scagnostics (autocog_), 4 autocog_smooth_line (autocog_), 4 autocog_square_counts (autocog_), 4 autocog_univariate_continuous (autocog_), 4 autocog_univariate_counts (autocog_), 4 autocog_univariate_discrete (autocog_), 4 known_layer_cogs, 8 layer_count, 8 layer_info, 3, 9, 10 panel_cogs, 10 plot_class, 3, 10 tibble, 10 bind_rows, 2 cog_desc, 2, 5 cog_group, 5 cog_spec, 6 field_info, 2, 7 known_cog_groups, 4, 5, 8, 8 12