This function returns a temporary track name, which would be deleted when the calling function exits.
Usage
temp_track_name(prefix = "", envir = parent.frame())
Arguments
- prefix
a prefix for the track name
- envir
environment to to pass the
withr::defer
function (do not change unless you know what you are doing)
Examples
func <- function() {
tmp <- temp_track()
print(tmp)
gtrack.create_sparse(tmp, description = "", intervals = gintervals.all(), values = rep(1, nrow(gintervals.all())))
gtrack.exists(tmp) # returns TRUE
a <- gextract(tmp, gintervals.all())
print(head(a))
return(tmp)
}
tmp <- func()
#> Error in temp_track(): could not find function "temp_track"
gtrack.exists(tmp) # returns FALSE
#> Error in eval(expr, envir, enclos): object 'tmp' not found