Learn R Programming

Momocs (version 0.2-03)

import.txt: Everything to convert .txt files to a list of coordinates.

Description

Takes a path list to .txt files and returns a list of coordinates arranged as matrices that can be passed to the Coo builder.

Usage

import.txt(txt.list, ...)

Arguments

txt.list
a list of full/relative path to .txt files. (see Details).
...
Complementary arguments to be passed to read.table within the function.

Value

  • A list of matrices of coordinates.

Details

.txt files must have coordinates arranged in two columns (i.e. x and y) with no header. The list of paths pointing to .txt files must be full if your working directory is different from your folder containing images, see Examples below.

See Also

import.jpg.

Examples

Run this code
txt.list <- list.files(path_to_your_folder_containing_.txt_files, full=TRUE)
# altenartively :
# setwd(path_to_your_folder_containing_.txt_files)
# txt.list <- list.files()
I <- import.txt(txt.list)
Coo(I)
I # that should be a Coo object

Run the code above in your browser using DataLab