Learn R Programming

HelpersMG (version 5.1)

tide.info: Annual tide calendar for one particular location

Description

Annual tide information. The columns are: Location, Longitude, Latitude, Phase, DateTime.local, DateTime.UTC, Tide.meter This function uses an API linking xtide software (https://flaterco.com/xtide/) with tide.info() function. You must have a working internet connection for this function.

Usage

tide.info(
  location = NULL,
  year = 2021,
  longitude = NULL,
  latitude = NULL,
  tz = NULL
)

Arguments

location

Textual information about location name

year

Year to get the calendar

longitude

Longitude to search for

latitude

Latitude to search for

tz

The time zone to format the local time

Value

Return a data.frame with annual tide calendar.

Details

tide.info gets the annual tide calendar for one particular location.

See Also

Other Periodic patterns of indices: index.periodic(), minmax.periodic(), moon.info(), sun.info()

Examples

Run this code
# NOT RUN {
library("HelpersMG")
Location <- "Les Hattes"
Year <- 2010
tide <- tide.info(Location, Year, tz="America/Cayenne")
plot(tide[, "DateTime.local"], tide[, "Tide.meter"], 
     type="l", bty="n", las=1, 
     main=tide[1, "Location"], 
     xlab=as.character(Year), ylab="Tide level in meter")

Location <- "Hawaii"
Year <- 2010
tide <- tide.info(Location, Year)

Location <- "Hanamaulu Bay, Kauai Island, Hawaii"
Year <- 2010
tide <- tide.info(Location, Year)
plot(tide[, "DateTime.local"], tide[, "Tide.meter"], 
     type="l", bty="n", las=1, 
     main=tide[1, "Location"], 
     xlab=as.character(Year), ylab="Tide level in meter")
     
tide <- tide.info(year=2010, longitude=-32, latitude=-4)
library(maps)
map(database = "world", regions = "Brazil", asp=1, 
    xlim=c(-80, -30), ylim=c(-33, 5))
points(tide[1, "Longitude"], tide[1, "Latitude"], col="red", pch=19)
points(-32, -4, col="blue", pch=19)
axis(1)
axis(2, las=1)

# Show the locations with data    
library(maps)
map(xlim=c(-180, 180), ylim=c(-90, 90))
title("Locations with harmonics data")
axis(1, at=seq(from=-180, to=180, by=45))
axis(2, las=1, at=seq(from=-90, to=90, by=15))
points(getFromNamespace(x="tide_location", ns="HelpersMG")[, c("longitude")], 
       getFromNamespace(x="tide_location", ns="HelpersMG")[, c("latitude")], 
       pch=".", col="red", cex=2)
# Another example
tikei_lon  <- (-144.5465183)
tikei_lat <- -14.9505897
Year <- 2021
tikei_tide <- tide.info(year=Year, longitude=tikei_lon, latitude=tikei_lat)
plot(tikei_tide[, "DateTime.local"], tikei_tide[, "Tide.meter"], 
     type="l", bty="n", las=1, 
     main=tikei_tide[1, "Location"], 
     xlab=as.character(Year), ylab="Tide level in meter")
# }

Run the code above in your browser using DataLab