Skip to contents

This is a convenience function that reads from the table "positions.postable". This table contains the primary positions data.

Usage

getPosdata(
  species = NULL,
  colony = NULL,
  dataResponsible = NULL,
  ringnumber = NULL,
  year = NULL,
  sessionId = NULL,
  individId = NULL,
  loadGeometries = F,
  loadImportDate = T,
  asTibble = T,
  limit = F
)

Arguments

species

Character string. Option to limit selection to one or a set of species.Default is NULL, indicating all species. The available choices can be seen in the column species_name_eng in the result from the function getSpecies().

colony

Character string. Option to limit selection to one or a set of colonies. Default is NULL. The available choices can be seen in the column colony_int_name in the result from the function getColonies().

dataResponsible

Character string. Option to limit selection to one or a set of names of data responsible persons. Note that this must conform to the name nomenclature used in the postable. Default is NULL. The available choices can be seen in the column name in the result from the function getNames().

ringnumber

Character string. Option to limit selection to one or a set of ring numbers. Default is NULL.

year

Character string. Option to limit selection to one or more years that the logging sessions span. The availablle choices can be found in the year_tracked column in the result form the getYears function.

loadGeometries

True, False. Should geometries be loaded from the columns lon_smooth2 and lat_smooth2? If True, the returned object is a simple features object with only rows of eqfilter3 == 1, and with lat_smooth2 and lon_smooth2 values. Default = False

loadImportDate

Boolean. Should results include the import date to the database? Default = True.

asTibble

Boolean. Should the result be given as a tibble instead of a lazy query? Tibble is slower, but also here forces the timezone to "UTC".

limit

FALSE or Integer. Limit the number of rows returned to this number. Default = False.

Value

A lazy query or optionally a tibble of postable records. In the case of loadGeometries = T (default), also of class sf (simple feature) with geometries based on lat lon.

Examples

if (FALSE) { # \dontrun{
connectSeatrack(Username = "testreader", Password = "testreader")

positions <- getPosdata(colony = "Kongsfjorden",
                dataResponsible = "Sebastien Descamps",
                species = "Little auk",
                limit = F,
                loadGeometries = F)

positions

# get data with geometries (default)
positions2 <- getPosdata(limit = 500)

positions2

#make a simple plot
plot(positions2["logger_model"], pch = 16)

} # }