| File | R Documentation |
Class representing a file containing code.
PaRe::Code -> File
new()Initializer method
File$new(repoPath, filePath)
repoPath(character)
Path to repository.
filePath(character)
Relative path to file
invisible(self)
getFunctions()Get method to get a list of Function objects
File$getFunctions()
(list)
List of Function objects.
getFunctionTable()Get method to retrieve the function table.
File$getFunctionTable()
(data.frame)
| column | data type |
| name | character |
| lineStart | integer |
| lineEnd | numeric |
| nArgs | integer |
| cycloComp | integer |
getType()Gets type of file
File$getType()
(character)
getFilePath()Gets relative file path
File$getFilePath()
(character)
getBlameTable()Gets table of git blame
File$getBlameTable()
(tibble)
clone()The objects of this class are cloneable with this method.
File$clone(deep = FALSE)
deepWhether to make a deep clone.
Other Representations:
Code,
Function,
Repository
fetchedRepo <- tryCatch(
{
# Set dir to clone repository to.
tempDir <- tempdir()
pathToRepo <- file.path(tempDir, "glue")
# Clone repo
git2r::clone(
url = "https://github.com/tidyverse/glue.git",
local_path = pathToRepo
)
# Create instance of Repository object.
repo <- PaRe::Repository$new(path = pathToRepo)
# Set fetchedRepo to TRUE if all goes well.
TRUE
},
error = function(e) {
# Set fetchedRepo to FALSE if an error is encountered.
FALSE
},
warning = function(w) {
# Set fetchedRepo to FALSE if a warning is encountered.
FALSE
}
)
if (fetchedRepo) {
files <- repo$getRFiles()
files[[1]]
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.