Learn R Programming

phenopix (version 2.4.5)

convert: Convert in data.frame a zoo or ts object

Description

This function converts an object of class ts or zoo in a data.frame with a column named time retrieved from index(x). It is designed for those unfamiliar with time series objects.

Usage

convert(x, year=NULL)

Value

A dataframe

Arguments

x

An object of class ts or zoo

year

A vector of length one with year of observation. If provided, a column with time in POSIX format is also returned

Author

Gianluca Filippa <gian.filippa@gmail.com>

Details

An object of class data.frame is returned with a column doy and optionally time at the end of the table.