Description Usage Arguments Details Value Author(s) See Also Examples
Search for the .R file that contains a function, and open
it in an editor. It searches for the file containing the
function definition, by grepping for the pattern
"^my.func.name <- function"
, where
my.func.name
is the name of func.
1 2 3 4 5 6 7 8 9 10 11 12 13 | edit.src.file(func, src.root = getOption("src.root"),
src.files = NULL, editor = getOption("editor"),
exclude.patterns = c("~", ".Rcheck", ".git", ".svn"))
kate(func, src.root = getOption("src.root"))
textmate(func, src.root = getOption("src.root"))
tm(func, src.root = getOption("src.root"))
mate(func, src.root = getOption("src.root"))
smultron(func, src.root = getOption("src.root"))
|
func |
the quoted function name, or the function's code |
src.root |
The parent folder of source code |
src.files |
an optional vector of filenames to search within |
editor |
the path to your editor. Default =
|
exclude.patterns |
vector of patterns passed to grep for files to exclude. |
There are functions which work with textmate on OSX (textmate, tm, mate; smultron), or on Linux (kate = KDE Advanced Text Editor).
Common usage scenarios are that you have a folder full of
R packages under development. In this case, set
src.root
, or better yet, the
options(src.root="/path/to/source/root")
to point
to the top level folder containing all the R packages. If
you also have a number of .R source files, then you can
provide these files via the src.files
argument.
nothing. The side effect is that an R source file is opened in an editor.
Mark Cowley, 26/2/07
1 2 3 4 5 | ## Not run:
edit.src.file("edit.src.file", "~/src/R")
edit.src.file("edit.src.file", "~/src/R", editor="open -a TextMate")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.