Learn R Programming

distops (version 0.1.0)

use_distance: Adds a distance function to the package

Description

This function adds a distance function to the package. It first creates the R/{distance_name}Distance.R file with the R wrapper function for the distance function. It then creates the src/{distance_name}Distance.cpp file with the C++ implementation of the distance function. It finally opens the latter file in the default editor. The user will be able to implement the desired distance function in a way compatible with the RcppParallel workflow.

Usage

use_distance(distance_name)

Value

Nothing.

Arguments

distance_name

A character string specifying the name of the distance that the user aims at implementing.

Examples

Run this code
# \donttest{
use_distance("euclidean")
# }

Run the code above in your browser using DataLab