Learn R Programming

vegtable (version 0.1.3)

clean: Clean orphaned records in vegtable object.

Description

Delete entries in slots header and species orphaned by manipulation of slots.

Usage

# S4 method for vegtable
clean(object, times=2, ...)

Arguments

object

A '>vegtable object.

times

Numeric value indicating how many times should be the cleaning be repeated.

...

Further arguments passed from or to other methods.

Value

A clean '>vegtable object.

Details

Orphaned records generated by modifications in some slots may cause a loss on the validity of '>vegtable objects. This function should be applied to optimise the allocated size of a '>vegtable object, as well. Since running cleaning only once does not assure the deletion of all orphaned entries, it is recommended to run it at least twice. This repetition of cleaning is controlled by the argument 'times'.

Examples

Run this code
# NOT RUN {
library(vegtable)
data(Kenya_veg)

## Direct manipulation of slot header generates an invalid object
Kenya_veg@header <- Kenya_veg@header[1:50,]
summary(Kenya_veg)

## Now apply cleaning
Kenya_veg <- clean(Kenya_veg)
summary(Kenya_veg)
# }

Run the code above in your browser using DataLab