browse {rscc}R Documentation

browse

Description

Creates a temporary HTML file with source codes and opens it into a browser using browseURL. Note that the source code is reformatted.

Usage

browse(prgs, simdf, n = (simdf[, 3] > 0), width.cutoff = 60, css = NULL)

Arguments

prgs

sourcecode object

simdf

similarity object

n

integer: comparisons to show (default: simf[,3]>0)

width.cutoff

integer: an integer in [20, 500]: if a line's character length is at or over this number, the function will try to break it into a new line (default: 60)

css

character: file name of CSS style for highlighting the R code

Value

invisibly the name of the temporary HTML file

Examples

# example files are taken from https://CRAN.R-project.org/package=SimilaR
files <- list.files(system.file("examples", package="rscc"), "*.R$", full.names=TRUE)
prgs  <- sourcecode(files)
simm  <- similarities(documents(prgs))
simdf <- matrix2dataframe(simm)
if (interactive()) browse(prgs, simdf)

[Package rscc version 0.2.1 Index]