Package bannercommenter

Similar documents
Consistent Banner Comments for R Scripts

Package datasets.load

Package rgho. R topics documented: January 18, 2017

Package lazydata. December 4, 2016

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

Package SEMrushR. November 3, 2018

Package WordR. September 7, 2017

Package labelvector. July 28, 2018

Package bisect. April 16, 2018

Package meme. November 2, 2017

Package catenary. May 4, 2018

Package meme. December 6, 2017

Package validara. October 19, 2017

Package stapler. November 27, 2017

Package kdtools. April 26, 2018

Package fastdummies. January 8, 2018

Package calpassapi. August 25, 2018

Package spelling. December 18, 2017

Package ECctmc. May 1, 2018

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

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

Package epitab. July 4, 2018

Package textrank. December 18, 2017

Package condusco. November 8, 2017

Package wrswor. R topics documented: February 2, Type Package

Package shinyfeedback

Package cancensus. February 4, 2018

Package lvec. May 24, 2018

Package gtrendsr. October 19, 2017

Package ezknitr. September 16, 2016

Package fitur. March 11, 2018

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

Package zebu. R topics documented: October 24, 2017

Package splithalf. March 17, 2018

Package docxtools. July 6, 2018

Package messaging. May 27, 2018

Package rzeit2. January 7, 2019

Package labelled. December 19, 2017

Package opencage. January 16, 2018

Package ssh. June 4, 2018

Package skynet. December 12, 2018

Package kirby21.base

Package httpcache. October 17, 2017

Package crossrun. October 8, 2018

Package TrafficBDE. March 1, 2018

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

Package datapasta. January 24, 2018

Package utf8. May 24, 2018

Package canvasxpress

Package knitrprogressbar

Package editdata. October 7, 2017

Package diagis. January 25, 2018

Package Rspc. July 30, 2018

Package gtrendsr. August 4, 2018

Package clipr. June 23, 2018

Package pomdp. January 3, 2019

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

Package styler. December 11, Title Non-Invasive Pretty Printing of R Code Version 1.0.0

Package leaflet.minicharts

Package internetarchive

Package auctestr. November 13, 2017

Package roperators. September 28, 2018

Package confidence. July 2, 2017

Package omu. August 2, 2018

Package dkanr. July 12, 2018

Package pmatch. October 19, 2018

Package sfc. August 29, 2016

Package BASiNET. October 2, 2018

Package fingertipsr. May 25, Type Package Version Title Fingertips Data for Public Health

Package vip. June 15, 2018

Package edfreader. R topics documented: May 21, 2017

Package vinereg. August 10, 2018

Package lumberjack. R topics documented: July 20, 2018

Package statsdk. September 30, 2017

Package phrasemachine

Package raker. October 10, 2017

Package zoomgrid. January 3, 2019

Package weco. May 4, 2018

Package semver. January 6, 2017

Package barcoder. October 26, 2018

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

Package reconstructr

Package sfdct. August 29, 2017

Package reval. May 26, 2015

Package edgarwebr. December 22, 2017

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

Package smoothr. April 4, 2018

Package redux. May 31, 2018

Package carbonate. R topics documented: October 14, 2018

Package gifti. February 1, 2018

Package tiler. June 9, 2018

Package Numero. November 24, 2018

Package ChoR. May 27, 2018

Package linkspotter. July 22, Type Package

Package covr. October 18, 2018

Package algorithmia. September 13, 2016

Package portsort. September 30, 2018

Package modules. July 22, 2017

Package sessioninfo. June 21, 2017

Package dyncorr. R topics documented: December 10, Title Dynamic Correlation Package Version Date

Transcription:

Type Package Package bannercommenter December 5, 2016 Title Make Banner Comments with a Consistent Format Version 0.1.0 Author Bill Venables <Bill.Venables@gmail.com> Maintainer Bill Venables <Bill.Venables@gmail.com> A convenience package for use while drafting code. It facilitates making stand-out comment lines decorated with bands of characters. The input tet strings are converted into R comment lines, suitably formatted. These are then displayed in a console window and, if possible, automatically transferred to a clipboard ready for pasting into an R script. Designed to save time when drafting R scripts that will need to be navigated and maintained by other programmers. License GPL (>= 2) Encoding UTF-8 LazyData true RoygenNote 5.0.1 Suggests knitr, rmarkdown, dplyr, datasets VignetteBuilder knitr NeedsCompilation no Repository CRAN Date/Publication 2016-12-05 14:49:23 R topics documented: banner............................................ 2 copy_to_clipboard..................................... 3 print.banner......................................... 4 Inde 5 1

2 banner banner Make a decorated comment in an R script Make a decorated multi-line comment from input strings and, if possible, transfer it to the clipboard ready for pasting into an R script (via the print method). banner(,..., emph = FALSE, snug = FALSE, upper = emph, centre = TRUE, leftsidehashes = 2 + emph, rightsidehashes = leftsidehashes, minhashes = (!snug) * (65 + 10 * emph), numlines = 1 + emph, bandchar = "#", center = centre) section(..., emph = TRUE) boup(..., rightsidehashes = 1, bandchar = "-") open_bo(..., minhashes = 0, rightsidehashes = 0, centre = FALSE, bandchar = "-") block(..., leftsidehashes = 3, rightsidehashes = 0, centre = FALSE, minhashes = 0, numlines = 0) A string, first line of the comment. If "", the zero-length string, only the top lines of the banner are made. If missing, in an interactive session the user will be prompted for the input strings, one per line, in the console.... Zero or more additional strings as etra lines. Strings may contain newline characters resulting in further line breaks. emph A logical value: Do you want this to be an emphasised comment? snug A logical value: Do you want the decoration to hug the strings closely? upper A logical value: Do you want the strings converted to upper case? centre A logical value: Do you want the tet strings centred? (alternative: left justified) leftsidehashes A positive integer: How many hashes go on the left side? rightsidehashes A non-negative integer: How many hashes go on the right side? minhashes A non-negative integer: What is the minimum number of hashes in the boundary lines? numlines A non-negative integer: How many lines of hashes above and below do you want? bandchar A single character. Used instead of # for all characters in the bands around the tet, apart from the first character of every line. center Alternative spelling of centre.

copy_to_clipboard 3 A character string vector returned invisibly, but automatically displayed in the console Functions Eamples section: Make a prominent banner such as might be useful at the beginning of a major code section boup: Make a minimally boed banner comment open_bo: Make a boed banner coment open at the right block: Make a simple block of comment lines banner("this should appear clearly and stand out.", "The lines are left justified by default.") section("this is the first line in a section heading", "and this is the second\nand this the third.") boup("this is a less obtrusive comment", "centred on multiple lines", center = TRUE, bandchar = ".") banner("this is an important side issue.", "Take note!", snug = TRUE, bandchar = "=") open_bo("this is a succinctly presented comment", "left justified and open at the right", "on multiple lines") block("this is a chatty comment. Entering it this way just", "saves a tiny bit of typing but it can be useful if", "you need multiple initial hash marks, as you may when", "using Emacs/ESS, for eample.", "Or if you want the lines centred for some odd reason.", center = TRUE) ## some authors like to use lines of a uniform length to separate code sections: boup("") copy_to_clipboard Transfer tet strings to the clipboard ready for paste This is only guaranteed for Windows; in the case of Linu you will need to have the clip command installed and visible on the PATH and for Mac OS you will need to have pbcopy similarly available. In any case the transfer to the clipboard is only activated while in an interactive session. copy_to_clipboard(,..., file = con)

4 print.banner a characeter string vector... additional arguments as for cat file Details a file or connection (usually left at the default) It behaves like base::cat but differs in three respects. First, if file is left missing, in an interactive session, the default file is a clipboard device, if possible. Second, the return value is invisible() rather than invisible(null) as it is for base::cat. Third, it only has a copying side-effect if used in an interactive session. In a non-interactive session it merely returns the argument, invisibly. Note the on Windows the function utils::writeclipboard offers a much more etensive range of possibilities for communicating with the clipboard device, but this facility is only available on Windows., invisibly (as for a print method) print.banner Print method for banner objects As well as printing the comment string in the console window the same tet strings are transferred to a clipboard, if possible, ready for pasting into the R script currently being drafted. ## S3 method for class 'banner' print(,...)... Not used A character string vector as procuced by banner() itself, invisibly. A side effect is that is transferred to a clipboard device, if possible

Inde banner, 2 block (banner), 2 boup (banner), 2 copy_to_clipboard, 3 open_bo (banner), 2 print.banner, 4 section (banner), 2 5