Dataframe_Combine: Creates a data frame containing up to five time series

View source: R/Dataframe_Combine.R

Dataframe_CombineR Documentation

Creates a data frame containing up to five time series

Description

Combines up to five time series, detrended where necessary, into a single data frame.

Usage

Dataframe_Combine(data.1, data.2, data.3, data.4 = 0, data.5 = 0,
  n = 3, names)

Arguments

n

Integer 1-5 specifying the number of time series. Default is 3.

data.1:5

Data frames with two columns containing in column

  • 1 - Continuous sequence of times spanning from the first to the final recorded observations.

  • 2 - Corresponding values detrended where necessary.

Value

A data frame containing all times from the first to the most up to date reading of any of the variables.

See Also

Detrend

Examples

#Formatting data
S20.Rainfall.df<-Perrine_df
S20.Rainfall.df$Date<-as.Date(S20.Rainfall.df$Date)
S20.OsWL.df<-S20_T_MAX_Daily_Completed_Detrend_Declustered[,c(2,4)]
S20.OsWL.df$Date<-as.Date(S20.OsWL.df$Date)
#Detrending O-sWL series at Site S20
S20.OsWL.Detrend<-Detrend(Data=S20.OsWL.df,Method = "window",PLOT=FALSE,
                         x_lab="Date",y_lab="O-sWL (ft NGVD 29)")
#Creating a dataframe with the date alongside the detrended OsWL series
S20.OsWL.Detrend.df<-data.frame(as.Date(S20.OsWL.df$Date),S20.OsWL.Detrend)
colnames(S20.OsWL.Detrend.df)<-c("Date","OsWL")
#Combining the two datasets by Date argument
S20.Detrend.df<-Dataframe_Combine(data.1<-S20.Rainfall.df,
                                 data.2<-S20.OsWL.Detrend.df,
                                 data.3=0,
                                 names=c("Rainfall","OsWL"))

rjaneUCF/MultiHazard documentation built on Aug. 17, 2024, 2:14 p.m.