| 1 |
trim_labels.item <- function(x,...){ |
| 2 |
l <- labels(x) |
| 3 |
if(!length(l)) return(x) |
| 4 |
lData <- [email protected] |
| 5 |
[email protected] <- gsub("[-+]?[0-9]+[.] ","",lData) |
| 6 |
labels(x) <- l |
| 7 |
x |
| 8 |
} |
| 9 |
|
| 10 |
trim_labels.data.set <- function(x,...){ |
| 11 |
for(i in seq_along(x)){ |
| 12 |
[email protected][[i]] <- trim_labels.item([email protected][[i]]) |
| 13 |
} |
| 14 |
x |
| 15 |
} |
| 16 |
|
| 17 |
setGeneric("trim_labels", |
| 18 |
function(x,...)standardGeneric("trim_labels")) |
| 19 |
|
| 20 |
setMethod("trim_labels","item.vector",trim_labels.item) |
| 21 |
setMethod("trim_labels","data.set",trim_labels.data.set) |