Learn R Programming

BioTrajectory (version 1.1.0)

readtrackData: 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)

Value

An object of class `trayectoria` containing the points (coordinates) of the object in each frame. The `trayectoria` object will include the `x` and `y` coordinates. If no object is detected in a frame, the corresponding coordinates will be set to `NA` in the `trayectoria` object.

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).

Examples

Run this code
# 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)

Run the code above in your browser using DataLab