Package lucid. August 24, 2018

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

Package datasets.load

Package fastdummies. January 8, 2018

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

Package docxtools. July 6, 2018

Package canvasxpress

Package vinereg. August 10, 2018

Package robotstxt. November 12, 2017

Package ECctmc. May 1, 2018

Package messaging. May 27, 2018

Package svalues. July 15, 2018

Package ezsummary. August 29, 2016

Package dalmatian. January 29, 2018

Package bisect. April 16, 2018

Package tidyimpute. March 5, 2018

Package OLScurve. August 29, 2016

Package calpassapi. August 25, 2018

Package validara. October 19, 2017

Package desplot. R topics documented: April 3, 2018

Package repec. August 31, 2018

Package BiocManager. November 13, 2018

Package WordR. September 7, 2017

Package iccbeta. January 28, 2019

Package editdata. October 7, 2017

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

Package deductive. June 2, 2017

Package interplot. R topics documented: June 30, 2018

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

Package SEMrushR. November 3, 2018

Package facerec. May 14, 2018

Package gtrendsr. August 4, 2018

Package githubinstall

Package citools. October 20, 2018

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

Package keyholder. May 19, 2018

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

Package projector. February 27, 2018

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

Package opencage. January 16, 2018

Package spark. July 21, 2017

Package weco. May 4, 2018

Package sfc. August 29, 2016

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

Package mdftracks. February 6, 2017

Package widyr. August 14, 2017

Package censusapi. August 19, 2018

Package gtrendsr. October 19, 2017

Package colf. October 9, 2017

Package knitrprogressbar

Package epitab. July 4, 2018

Package tidylpa. March 28, 2018

Package coga. May 8, 2018

Package embed. November 19, 2018

Package catenary. May 4, 2018

Package rsppfp. November 20, 2018

Package dbx. July 5, 2018

Package reval. May 26, 2015

Package crossword.r. January 19, 2018

Package TrafficBDE. March 1, 2018

Package splithalf. March 17, 2018

Package rprojroot. January 3, Title Finding Files in Project Subdirectories Version 1.3-2

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

Package sankey. R topics documented: October 22, 2017

Package essurvey. August 23, 2018

Package jstree. October 24, 2017

Package reconstructr

Package jdx. R topics documented: January 9, Type Package Title 'Java' Data Exchange for 'R' and 'rjava'

Package pairsd3. R topics documented: August 29, Title D3 Scatterplot Matrices Version 0.1.0

Package comparedf. February 11, 2019

Package RNAseqNet. May 16, 2017

Package quickreg. R topics documented:

Package linkspotter. July 22, Type Package

Package spelling. December 18, 2017

Package edfreader. R topics documented: May 21, 2017

Package farver. November 20, 2018

Package queuecomputer

Package IATScore. January 10, 2018

Package shinyfeedback

Package glmnetutils. August 1, 2017

Package nlgeocoder. October 8, 2018

Package auctestr. November 13, 2017

Package benchmarkme. R topics documented: February 26, Type Package Title Crowd Sourced System Benchmarks Version 0.2.

Package internetarchive

Package lumberjack. R topics documented: July 20, 2018

Package CorporaCoCo. R topics documented: November 23, 2017

Package available. November 17, 2017

Package dkanr. July 12, 2018

Package postgistools

Package ether. September 22, 2018

Package strat. November 23, 2016

Package labelvector. July 28, 2018

Package rcv. August 11, 2017

Package modmarg. R topics documented:

Package datapasta. January 24, 2018

Package gifti. February 1, 2018

Package sfdct. August 29, 2017

Package UNF. June 13, 2017

Package tidytree. June 13, 2018

Package pcr. November 20, 2017

Package barcoder. October 26, 2018

Transcription:

Version 1.6 Package lucid August 24, 2018 Title Printing Floating Point Numbers in a Human-Friendly Format Description Print vectors (and data frames) of floating point numbers using a non-scientific format optimized for human readers. Vectors of numbers are rounded using significant digits, aligned at the decimal point, and all zeros trailing the decimal point are dropped. See: Wright (2016). Lucid: An R Package for Pretty-Printing Floating Point Numbers. In JSM Proceedings, Statistical Computing Section. Alexandria, VA: American Statistical Association. 2270-2279. LazyData yes License GPL-3 URL https://github.com/kwstat/lucid BugReports https://github.com/kwstat/lucid/issues VignetteBuilder knitr Imports nlme Suggests broom, dplyr, knitr, lattice, lme4, rjags, testthat Encoding UTF-8 RoxygenNote 6.1.0 NeedsCompilation no Author Kevin Wright [aut, cre] (<https://orcid.org/0000-0002-0617-8673>) Maintainer Kevin Wright <kw.stat@gmail.com> Repository CRAN Date/Publication 2018-08-24 21:02:17 UTC R topics documented: antibiotic.......................................... 2 lucid............................................. 3 vc.............................................. 5 Index 7 1

2 antibiotic antibiotic Effectiveness of 3 antibiotics against 16 bacterial species. Description Format Details Source Effectiveness of 3 antibiotics against 16 bacterial species. A data frame with 16 observations on the following 5 variables. bacteria bacterial species, 16 levels penicillin MIC for penicillin streptomycin MIC for streptomycin neomycin MIC for neomycin gramstain Gram staining (positive or negative) The values reported are the minimum inhibitory concentration (MIC) in micrograms/milliliter, which represents the concentration of antibiotic required to prevent growth in vitro. Will Burtin (1951). Scope. Fall, 1951. References Wainer, H. (2009). A Centenary Celebration for Will Burtin: A Pioneer of Scientific Visualization. Chance, 22(1), 51-55. https://chance.amstat.org/2009/02/visrev221/ Wainer, H. (2009). Visual Revelations: Pictures at an Exhibition. Chance, 22(2), 46 54. https://chance.amstat.org/2009/04/vi Wainer, H. (2014). Medical Illuminations: Using Evidence, Visualization and Statistical Thinking to Improve Healthcare. Examples data(antibiotic) lucid(antibiotic) ## Not run: # Plot the data similar to Fig 2.14 of Wainer's book, "Medical Illuminations" require(lattice) require(reshape2) # Use log10 transform

lucid 3 dat <- transform(antibiotic, penicillin=log10(penicillin), streptomycin=log10(streptomycin), neomycin=log10(neomycin)) dat <- transform(dat, sgn = ifelse(dat$gramstain=="neg", "-", "+")) dat <- transform(dat, bacteria = paste(bacteria, sgn)) dat <- transform(dat, bacteria=reorder(bacteria, -penicillin)) dat <- melt(dat) op <- tpg <- trellis.par.get() tpg$superpose.symbol$pch <- toupper(substring(levels(dat$variable),1,1)) tpg$superpose.symbol$col <- c("darkgreen","purple","orange") trellis.par.set(tpg) dotplot(bacteria ~ value, data=dat, group=variable, cex=2, scales=list(x=list(at= -3:3, labels=c('.001', '.01', '.1', '1', '10', '100', '1000'))), main="bacterial response to Neomycin, Streptomycin, and Penicillin", xlab="minimum Inhibitory Concentration (mg/l)") trellis.par.set(op) ## End(Not run) lucid Lucid printing Description Usage Format a column of numbers in a way to make it easy to understand. ## Default S3 method: ## S3 method for class 'numeric' ## S3 method for class 'data.frame'

4 lucid ## S3 method for class 'matrix' ## S3 method for class 'list' ## S3 method for class 'tbl_df' Arguments x dig Details Value na.value Object to format. Number of significant digits to use in printing. Character string to use instead of NA for numeric missing values. Default is NULL, which does nothing.... Additional arguments passed to the data.frame method. Output from R is often in scientific notation, which makes it difficult to quickly glance at numbers and gain an understanding of the relative values. This function formats the numbers in a way that makes interpretation of the numbers _immediately_ apparent. The sequence of steps in formatting the output is: (1) zap to zero (2) use significant digits (3) drop trailing zeros after decimal (4) align decimals. See Also Text, formatted in a human-readable way. Standard R methods are used to print the value. signif Examples x0 <- c(123, 12.3, 1.23,.123456) # From Finney, page 352 print(x0) lucid(x0, dig=2) x1 <- c(123, NA, 1.23, NA) lucid(x1, na.value="--") signif(mtcars[15:20,]) lucid(mtcars[15:20,]) x2 <- c(1/3, 5/3, 1, 1.5, 2, 11/6, 5/6, 8.43215652105343e-17) print(x2) lucid(x2)

vc 5 # Which coef is 0? How large is the intercept? df1 <- data.frame(effect=c(-13.5, 4.5, 24.5, 6.927792e-14, -1.75, 16.5, 113.5000)) rownames(df1) <- c("a","b","c","c1","c2","d","(intercept)") print(df1) lucid(df1) # Which are smallest/largest/significant variance components df2 <- data.frame(effect=c("hyb","region","region:loc","hyb:region", "yr","hyb:yr","region:yr","r!variance"), component=c(10.9,277,493,1.30e-04,126,22.3,481,268), std.error=c(4.40,166,26.1,1.58e-06,119,4.50,108,3.25), z.ratio=c(2.471,1.669,18.899,82.242,1.060,4.951,4.442,82.242), constraint=c("pos","pos","pos","bnd","pos","pos","pos","pos")) print(df2) lucid(df2) vc Extract variance components from mixed models Description Extract the variance components from a fitted model. Currently supports asreml, lme4, nlme and mcmc.list objects. Usage ## Default S3 method: ## S3 method for class 'asreml' vc(object, gamma = FALSE,...) ## S3 method for class 'lme' ## S3 method for class 'glmermod' ## S3 method for class 'lmermod' ## S3 method for class 'mcmc.list' vc(object, quantiles = c(0.025, 0.5, 0.975),...)

6 vc Arguments Details Value object A fitted model object... Not used. Extra arguments. gamma quantiles If gamma=false, then the gamma column is omitted from the results from asreml The quantiles to use for printing mcmc.list objects The extracted variance components are stored in a data frame with an additional vc.xxx class that has an associated print method. A data frame or other object. Examples ## Not run: require("nlme") data(rail) m3 <- lme(travel~1, random=~1 Rail, data=rail) vc(m3) ## effect variance stddev ## (Intercept) 615.3 24.81 ## Residual 16.17 4.021 require("lme4") m4 <- lmer(travel~1 + (1 Rail), data=rail) vc(m4) ## grp var1 var2 vcov sdcor ## Rail (Intercept) <NA> 615.3 24.81 ## Residual <NA> <NA> 16.17 4.021 require("asreml") ma <- asreml(travel~1, random=~rail, data=rail) vc(ma) ## effect component std.error z.ratio constr ## Rail!Rail.var 615.3 392.6 1.6 pos ## R!variance 16.17 6.6 2.4 pos # See vignette for rjags example # To change the number of digits, use the print function. print(vc(m3), dig=5) ## End(Not run)

Index Topic datasets antibiotic, 2 antibiotic, 2 lucid, 3 signif, 4 vc, 5 7