print.lib: Print a data library

Description Usage Arguments Value See Also Examples

View source: R/utilities.R

Description

A class-specific instance of the print function for data libraries. The function prints the library in a summary manner. Use verbose = TRUE to print the library as a list.

Usage

1
2
## S3 method for class 'lib'
print(x, ..., verbose = FALSE)

Arguments

x

The library to print.

...

Any follow-on parameters.

verbose

Whether or not to print the library in verbose style. By default, the parameter is FALSE, meaning to print in summary style.

Value

The object, invisibly.

See Also

Other lib: is.lib(), lib_add(), lib_copy(), lib_delete(), lib_info(), lib_load(), lib_path(), lib_remove(), lib_replace(), lib_size(), lib_sync(), lib_unload(), lib_write(), libname()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Create temp directory
tmp <- tempdir()

# Create data library
libname(dat, tmp)

# Add data to library
lib_add(dat, iris, ToothGrowth, PlantGrowth)

# Print library summary 
print(dat)
# library 'dat': 3 items
# - attributes: not loaded
# - path: C:\Users\User\AppData\Local\Temp\RtmpCSJ6Gc
# - items:
#          Name Extension Rows Cols   Size        LastModified
# 1        iris       rds  150    5 7.8 Kb 2020-11-05 22:26:59
# 2 PlantGrowth       rds   30    2 2.5 Kb 2020-11-05 22:26:59
# 3 ToothGrowth       rds   60    3 3.4 Kb 2020-11-05 22:26:59

# Clean up
lib_delete(dat)

libr documentation built on Oct. 10, 2021, 1:07 a.m.