docr.example_df: Print a data frame for RD documentation in examples

Description Usage Author(s) See Also Examples

View source: R/docr_example_df.R

Description

docr.example_df

Usage

1
docr.example_df(df, just_head = T, comments = NULL, write_fun = NULL)

Author(s)

Carl S.A. Boneri, carl.boneri@whyles.com

See Also

Other Documentation functions: docr.author, docr.clean_fun, docr.defaults_prompt, docr.defaults, docr.describe_df, docr.family, docr.fun, docr.has_defaults, docr.install_r_only, docr.make_license, docr.meta_private, docr.meta_public, docr.param

Examples

 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
 > docr.example_df(mtcars)

 #'=================  ====  ===  ====  ===  ====
 #'row_idx             mpg  cyl  disp   hp  drat
 #'=================  ====  ===  ====  ===  ====
 #'Mazda RX4          21.0    6   160  110  3.90
 #'Mazda RX4 Wag      21.0    6   160  110  3.90
 #'Datsun 710         22.8    4   108   93  3.85
 #'Hornet 4 Drive     21.4    6   258  110  3.08
 #'Hornet Sportabout  18.7    8   360  175  3.15
 #'Valiant            18.1    6   225  105  2.76
 #'=================  ====  ===  ====  ===  ====

 # NOW SET COMMENTS ON THE DATA FRAME ITSELF

> docr.example_df(mtcars, comments  = "these are cars")
# these are cars

=================  ====  ===  ====  ===  ====
row_idx             mpg  cyl  disp   hp  drat
=================  ====  ===  ====  ===  ====
Mazda RX4          21.0    6   160  110  3.90
Mazda RX4 Wag      21.0    6   160  110  3.90
Datsun 710         22.8    4   108   93  3.85
Hornet 4 Drive     21.4    6   258  110  3.08
Hornet Sportabout  18.7    8   360  175  3.15
Valiant            18.1    6   225  105  2.76
=================  ====  ===  ====  ===  ====

CarlBoneri/roxydoc2 documentation built on Nov. 6, 2019, 8:01 a.m.