R/convert.R

Defines functions convert

Documented in convert

convert <- function(x, year=NULL) {
	if (!inherits(x, 'ts') |  !inherits(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 Aug. 9, 2023, 5:10 p.m.