print.tw: Printing the results of TWINSPAN

Description Usage Arguments Details Value See Also Examples

Description

Generic print function applicable on object of class tw, created by function twinspan. With appropriate setting of its arguments returns detail results of TWINSPAN (including indicator species or two-way sorted table).

Usage

1
2
## S3 method for class 'tw'
print(x, what = NULL, clusters = NULL, ...)

Arguments

x

Object of class 'tw', created by twinspan function.

what

What should be printed. Default = NULL (only standard output, i.e. data.frame with three columns stored in x$classif is returned). Should be (partial match to) one of c('species.names', 'order.plots', 'reading.data', 'input.parameters', 'levels', 'table', 'twi'). See Details for explanation.

clusters

Vector of integers. For which clusters (in case of modified TWINSPAN) the results should be returned? Default = NULL (i.e. information will be returned for all created clusters).

...

Arguments passed to default print function. Not implemented here.

Details

Function print.tw can access different outputs generated by TWINSPAN program, namely those stored in tw.PUN and tw.TWI files in /exec subdirectory. Printed output somewhat differ for standard and modified TWINSPAN, since modified TWINSPAN records information separately for each division, while standard TWINSPAN generate only one output files for all divisions.

Argument what can have the following values:

Value

If what is 'species.names' or 'order.plots', output is a data.frame. If what is 'reading.data', 'input.parameters', 'levels', 'table' or 'twi', output is printed into standard connection, usually console (if not redirected by sinc). This output can be recorded using capture.output as a character vector (each element equals to one line of original console output). Such captured output could be e.g. written to file using write.table function (see Examples).

In case of modified TWINSPAN, the results for individual hierarchical divisions are separated by lines of '@@@@@...'.

See Also

summary.tw, twinspan

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data (danube)
tw <- twinspan (danube$spe)
print (tw, 'table')

## The output of print function could be captured by "capture.output" function, 
## and writen into a file using e.g. "write.table":
## Not run: 
write.table (file = 'table.txt', capture.output (print (tw, 'table')), quote = F, row.names = F)
system (shell ('notepad.exe table.txt'))
## End(Not run)

zdealveindy/twinspanR documentation built on March 13, 2021, 8:35 a.m.