View source: R/classification2PAM.R
classification2PAM | R Documentation |
convert a classification timetable into a classification timeseries
classification2PAM(from, to, classification, addTO, missing = NA)
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. |
the classification in addTO dataset
#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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.