utils: Utils

Description Usage Arguments Author(s)

Description

Miscellaneous utility functions. Note that some of these only work under Windows.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
## open working directory
openwd()

## collapse elements without separator
collapse(...)

## write to Windows clipboard
write_cb(x, limit = 32, quote = FALSE, dec = ",", sep = "\t",
         row.names = FALSE, col.names = FALSE, ...)

## read from Windows clipboard
read_cb(dec = ",", sep = "\t", ...)

## return today's date in yyyymmdd format
today()

## return current time
now()

## read and save as
convert(file,
        from = c("csv2", "csv", "delim2", "delim", "dta"),
        to = c("csv", "csv2", "delim2", "delim", "dta"), ...)

## plot multiple ggplot2 objects
multiplot(..., cols = 1, layout = NULL)

## return proportional table
prop_table(x, ...)

## translate special characters to HTML or LaTeX
sanitize_specials(char, type = c("html", "latex"))

## read Excel file as data.frame
readxl(...)

## source file without printing/plotting
quiet_source(file)

Arguments

x

The object to be written to clipboard, preferably a vector, matrix or data frame.

limit

The limit on the text to be written to the clipboard. Defaults to 32Kb.

quote

A logical value (TRUE or FALSE) or a numeric vector. If TRUE, any character or factor columns will be surrounded by double quotes. If a numeric vector, its elements are taken as the indices of columns to quote. In both cases, row and column names are quoted if they are written. If FALSE, nothing is quoted. Defaults to FALSE.

dec

The string to use for decimal points in numeric or complex columns; must be a single character. Defaults to ",".

sep

The field separator string. Values within each row of x are separated by this string. Defaults to "\t".

row.names

Either a logical value indicating whether the row names of x are to be written along with x, or a character vector of row names to be written. Defaults to FALSE.

col.names

Either a logical value indicating whether the column names of x are to be written along with x, or a character vector of column names to be written. Defaults to FALSE.

file

File name.

from

Original format.

to

Format to which the file must be converted.

cols

Desired number of columns.

layout

Plot layout; optional.

char

Character vector.

type

Translate to html or latex.

...

For collapse0: Elements to be collapsed;
For write_cb: Other arguments to be passed to write.table;
For read_cb: Other arguments to be passed to read.table;
For multiplot: ggplot2 objects;
For readxl: Arguments to be passed to read_excel.

Author(s)

brechtdv@gmail.com


brechtdv/bd documentation built on June 19, 2019, 8:53 p.m.