create_time_series: Create Time Series

View source: R/create_time_series.R

create_time_seriesR Documentation

Create Time Series

Description

Create Time Series

Usage

create_time_series(
  rasters,
  x = 3.57,
  y = 50.35,
  years,
  start_week = 1,
  end_week = 52
)

Arguments

rasters

An output from create_raster_stack()

x

An x coordinate (longitude)

y

A y coordinate (latitude)

years

A vector stating for which years the time series will be extracted

start_week

A number of first week in the output RasterStack. The default is 1

end_week

A number of last week in the output RasterStack. The default is 52

Value

A data.frame with three columns: time, value, variable.

Examples

## Not run: 
  Path <- "C:/Google Drive/Corvus Geostat - Jakub Nowosad/"
  Path <- "../corvus_dynamic_outputs/"
  input_file <- paste0(Path,"NetCDF/DxResults_Cc_2010-2015.nc")
  AllYears <- extract_data_list(input_file, "Weekly Growth Index",
                              years = 2000:2014)
  rasters <- create_raster_stack(AllYears, years = 2000:2014)

  cts <- create_time_series(rasters,
                          years = 2000:2014,
                          x = 3.57, y = 50.35)

  library(ggplot2)
  ggplot(cts, aes(time, value)) + geom_line()

## End(Not run)

aniaszy/ffipm documentation built on July 3, 2022, 2:40 a.m.