classification2PAM: Timetable to timeseries

View source: R/classification2PAM.R

classification2PAMR Documentation

Timetable to timeseries

Description

convert a classification timetable into a classification timeseries

Usage

classification2PAM(from, to, classification, addTO, missing = NA)

Arguments

from

start of event that was classified (generally SOARprep output)

to

end of event that was classified (generally SOARprep output)

classification

of event (generally classifyPAM()$states output )

addTO

data which the classifications are to be added to (e.g. PAM_data$pressure)

missing

Missing value replacement. By default NA.

Value

the classification in addTO dataset

Examples

#data(bee_eater)
#PAM_data = bee_eater

#twl = GeoLight::twilightCalc(PAM_data$light$date, PAM_data$light$obs,
#                             LightThreshold = 2, ask = FALSE)


#TOclassify = pamPREP(PAM_data,
#                     method="pressure",
#                     twl = twl,
#                     Pdiff_thld = 2,
#                     light_thld = 2)

#classification = classifyPAM((TOclassify$total_daily_duration *
#                              log(TOclassify$night_P_diff+0.001 )
#                              * TOclassify$total_daily_P_change),
#                             states=3, "hmm")$cluster

#pressure_classification = classification2PAM(from = TOclassify$start,
#                                             to =TOclassify$end,
#                                             classification = classification,
#                                             addTO = PAM_data$pressure,
#                                             missing = NA)

#pressure_classification[pressure_classification == NA] = 0

#plot(PAM_data$pressure$date, PAM_data$pressure$obs,
#     col= viridis::viridis(4)[pressure_classification+1],
#     type="o", pch=16, cex=0.6)


KiranLDA/PAMLr documentation built on March 6, 2023, 1:40 p.m.