| 1 |
"%#%" <- function(x,descr){ |
| 2 |
description(x) <- descr |
| 3 |
return(x) |
| 4 |
} |
| 5 |
|
| 6 |
|
| 7 |
"%##%" <- function(x,annot){ |
| 8 |
for(n in names(annot)){ |
| 9 |
annotation(x)[n] <- as.character(annot[n]) |
| 10 |
} |
| 11 |
return(x) |
| 12 |
} |
| 13 |
|
| 14 |
|
| 15 |
"%@%" <- function(x,nm){ |
| 16 |
nm <- substitute(nm) |
| 17 |
if(typeof(nm)=="symbol"){ |
| 18 |
nm <- deparse(nm) |
| 19 |
} else { |
| 20 |
nm <- eval.parent(nm) |
| 21 |
} |
| 22 |
attr(x,nm) |
| 23 |
} |
| 24 |
|
| 25 |
"%@%<-" <- function(x,nm,value){ |
| 26 |
nm <- substitute(nm) |
| 27 |
if(typeof(nm)=="symbol"){ |
| 28 |
nm <- deparse(nm) |
| 29 |
} else { |
| 30 |
nm <- eval.parent(nm) |
| 31 |
} |
| 32 |
attr(x,nm) <- value |
| 33 |
return(invisible(x)) |
| 34 |
} |