read_nmea: Extract NMEA sentences

Description Usage Arguments Value Examples

View source: R/read-nmea.R

Description

For well-formed NMEA, existing tools for reading text are likely more useful

Usage

1
2
3
4
5
6
7
read_nmea(
  x,
  ...,
  sentence_start = c("$", "!"),
  sentence_end = "\n",
  max_length = 82L
)

Arguments

x

An object from which to extract NMEA sentences. For the default method this can be a raw() vector, a filename, a URL, or a connection.

...

Unused

sentence_start

A vector of possible characters that denote the start of a sentence. These must be a single character.

sentence_end

A sequence that denotes the end of a sentence. The NMEA specification suggests that sentences always end with a carriage return (\r) and a new line (\n); however, because these files are opened and saved on various systems, a often only a newline follows a sentence.

max_length

The maximum number of characters to scan after and including sentence_start before giving up on finding sentence_end. The NMEA specification suggest the maximum length is 82 characters, however extensions occasionally send longer sentences. This values includes both sentence_start and sentence_end.

Value

An nmea() vector.

Examples

1
2
file <- system.file("extdata/basic.nmea", package = "nmea")
read_nmea(file)

paleolimbot/nmea documentation built on April 12, 2021, 2:10 a.m.