sourcetools (version 0.1.7)

tokenize_file: Tokenize R Code

Description

Tools for tokenizing R code.

Usage

tokenize_file(path)

tokenize_string(string)

tokenize(file = "", text = NULL)

Value

A data.frame with the following columns:

valueThe token's contents, as a string.
rowThe row where the token is located.
columnThe column where the token is located.
typeThe token type, as a string.

Arguments

file, path

A file path.

text, string

R code as a character vector of length one.

Examples

Run this code
tokenize_string("x <- 1 + 2")

Run the code above in your browser using DataCamp Workspace