ts_extract: Extract and Transform Time Series Data

View source: R/zonal.R

ts_extractR Documentation

Extract and Transform Time Series Data

Description

This function processes an input dataset by reshaping it from wide to long format, separating columns into descriptions and dates, and renaming the resulting dataset for further analysis.

Usage

ts_extract(output, ID)

Arguments

output

A data frame containing the time series data in wide format. It must have a column with the name matching ID and other columns with names in the format "description_Date" (e.g., "temp_2024-01-01").

ID

A character string specifying the column name that uniquely identifies rows in the dataset.

Value

A transformed data frame with the following changes:

description

The variable names extracted from the original column names.

Date

A Date column converted from the original column names.

value

The associated values for each combination of ID, description, and Date.


mikejohnson51/zonal documentation built on Dec. 9, 2024, 11:52 p.m.