% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dm_join_daily_clim.R
\name{dm_join_daily_clim}
\alias{dm_join_daily_clim}
\title{Join daily climate summaries to daily dendrometer statistics}
\usage{
dm_join_daily_clim(daily_obj, clim_daily)
}
\arguments{
\item{daily_obj}{Output of \code{daily.data()} with class \code{"daily_output"}.}

\item{clim_daily}{Climate input. This can be a daily climate table, a
standardized climate object returned by \code{read.climate()}, a raw
climate data frame, or a valid climate file path.}
}
\value{
The \code{daily.data()} output with climate columns appended. The returned
object has class \code{c("daily_output_clim", "daily_output", ...)}.
}
\description{
Joins daily climate summaries to the output of \code{daily.data()} by
calendar date.

The climate input can be:
\itemize{
  \item the output of \code{dm_daily_clim()}
  \item the output of \code{read.climate()}
  \item a raw climate data frame
  \item a valid climate file path readable by \code{read.climate()}
}

If the supplied climate input is not already a daily climate table, it will
first be converted to daily summaries with \code{dm_daily_clim()} using
default daily means for numeric variables.
}
\examples{
\donttest{
data(nepa17)
data(ktm_clim_hourly)

dd <- daily.data(df = nepa17[1:1000, ], TreeNum = 1)

clim_std <- read.climate(
  ktm_clim_hourly,
  time_col = "TIME",
  vars = c("temp", "prec", "VPD", "RH"),
  verbose = FALSE
)

clim_day <- dm_daily_clim(
  clim_std,
  mean_vars = c("temp", "VPD", "RH"),
  max_vars  = c("temp", "VPD"),
  sum_vars  = c("prec")
)

dd_clim <- dm_join_daily_clim(dd, clim_day)
head(dd_clim)
}

}
