readtrackData: Reads tracking data from a specified file.

View source: R/readtrackData.R

readtrackDataR Documentation

Reads tracking data from a specified file.

Description

Reads a text file containing tracking data, where each line represents coordinates. If a line contains "null", it adds NA values for that entry. Optionally, it can remove rows with NA values.

Usage

readtrackData(file, na.rm = FALSE)

Arguments

file

A character string specifying the path to the file containing the tracking data.

na.rm

A logical value indicating whether to remove rows with NA values (default is FALSE).

Value

A data frame with two columns ('x' and 'y') containing the coordinates read from the file. If 'na.rm' is TRUE, rows with NA values are omitted.

Examples

# Read tracking data from a file
path <- system.file('extdata/track.txt', package='BioTrajectory')
tracking_data <- readtrackData(path, na.rm = TRUE)
# Print the resulting data frame
print(tracking_data)


BioTrajectory documentation built on June 8, 2025, 11:54 a.m.