Learn R Programming

sourcetools (version 0.1.2)

tokenize_file: Tokenize R Code

Description

Tools for tokenizing R code.

Usage

tokenize_file(path)
tokenize_string(string)

Arguments

path
A file path.
string
R code as a character vector of length one.

Value

A data.frame with the following columns:
value
The token's contents, as a string.
row
The row where the token is located.
column
The column where the token is located.
type
The token type, as a string.

Examples

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

Run the code above in your browser using DataLab