Description Usage Arguments Details Author(s) See Also Examples
Creates a new branch containing the current code in rvenv$currcode.
1 | saveb(bid, desc)
|
bid |
Branch id, inserted before the .R extension in the name of the newly-created file. |
desc |
Description of the branch. |
This function creates a new branch file containing the current code in rvenv$currcode. The name of the new file will be created by appending rvenv$currbasenm, '.', the branch id bid
, and '.R'. In addtion, the description desc
will have '# ' prepended to it and placed before the "# RV history end" line in the file.
For example, file pima.0.R
begins with the following lines:
1 2 3 | # RV history start
# original code
# RV history end
|
If the code is changed and then saved with the command saveb(1, "save branch 1")
, the newly-created file pima.1.R
will begin with the following lines:
1 2 3 4 5 6 7 | # RV history start
# original code
# save branch 1
# Time: YYYY-MM-DD Hour:Minute:Second
# Revisited by:
# UserID - Description
# RV history end
|
If no "# RV history end" line is found in the code being saved (because it was mistakenly edited by the user or for other reasons), the following lines will be prepended to the file in this case:
1 2 3 4 5 6 7 | # RV history start
# WARNING: RV history missing and recreated
# save branch 1
# Time: YYYY-MM-DD Hour:Minute:Second
# Revisited by:
# UserID - Description
# RV history end
|
The new file can then be loaded with the loadb
command. For example, suppose that the file pima.0.R
is loaded with loadb("pima.0.R")
, edited, and then saved with saveb(1, "save branch 1")
. That will create file pima.1.R
which can later be reloaded with loadb("pima.1.R")
.
Norm Matloff
edt
loadb
makebranch0
nxt
runb
rvinit
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.