tidal_codes | R Documentation |
Creates a numerical code for the tide state in relation to the closest low tide peak.
tidal_codes(observations, tide_table, round_digits = 1)
observations |
data to which tide code will be appended; must have a column named "date" with datetime info in POSIXct format. |
tide_table |
a tide table upon tide codes will be calculated; must have a column named "date" with datetime info in POSIXct format and another column named "type" with values 'High' or 'Low'. |
round_digits |
defines the accuracy of tide codes. If round_digits = 1 (default), observations are coded per hour. If round_digits = 0.5, creates half-hour tide codes. |
For each observation, the time difference to the nearest low tide is calculated (in hours) and coded into a numerical category where 0 represents low tide and 6 high tide. If tide is ebbing, values are negative. If tide is rising values are positive.
Note: To ensure tide code is calculated accurately for the observations given,
you must ensure that observation dates contain a time zone attribute. You can
define this with the field tz
in as.POSIXct
. For help with
accepted time zone codes, see OlsonNames
.
The observations
data frame entered with a new column named
'tide_code'.
tidalCodes(observations, tides_january)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.