R/convert.R

Defines functions convert

Documented in convert

convert <- function(x, year=NULL) {
	if (class(x)!='ts' |  class(x)!='zoo')
	time.new <- index(x)
	x.df <- as.data.frame(x)
	rownames(x.df) <- NULL
	x.df$doy <- time.new
	if (!is.null(year)) {
		time.posix <- as.POSIXct(strptime(paste(year, time.new, sep='-'), format='%Y-%j'))
		x.df$time <- time.posix
	}
	return(x.df)
}

Try the phenopix package in your browser

Any scripts or data that you put into this service are public.

phenopix documentation built on May 2, 2019, 4:50 p.m.