By making the revision revision number visible in my R scripts

I put this thing in my sources (...) (right, now this is just one, plus test scripts).

REVISION = (function(x) substring(x, first=7, last=nchar(x)-2))("$Rev: 8727 $")

but how do "real" R programmers do it?

+3
source share
1 answer

This is a pretty good solution. A regular expression can be more reliable if you have fewer or more digits: replace the beginning $Rev :and the end $with empty lines, and you should leave the revision to the left.

The only problem with the properties of each file is that they are updated only when this file is updated by subversion.

( ) . DESCRIPTION ) , b) , , .

Revision: $Rev$

R read.dcf(), , .

+2

Source: https://habr.com/ru/post/1725375/


All Articles