# simple example
v=1:100/10 +.0111
vr=signif(v,digits=2)
# print.unf shows in standard format, including version and digits
print(unf(v))
# as.character will return base64 section only for comparisons
as.character(unf(v))
# this is false, since computed base64 values UNF's differ
as.character(unf(v))==as.character(unf(vr))
# this is true, since computed UNF's base64 values are the same at 2 significant digits
as.character(unf(v, digits=2))==as.character(unf(vr))
# WARNING: this is false, since UNF's values are the same, but
# number of calculated digits differ , probably not the comparison
# you intend
identical(unf(v,digits=2),unf(vr))
# compute a fingerprint of longley at 10 significant digits of accuracy
# this fingerprint can be stored and verified when reading the dataset
# later
data(longley)
mf10<-unf(longley,digits=10);
#printable representation, prints seven UNF's, one for each vector
print(mf10)
# summarizes the base64 portion of the unf for each vector into a
# single base64 UNF representing entire dataset
summary(mf10)
Run the code above in your browser using DataLab