Displaying 1 result from an estimated 1 matches for "myunit".
Did you mean:
pyunit
2008 Jun 25
1
expression, strsplit, ...
...-3 kg^-2 l^4"
> makeUnits(expr) # this works, and produces:
# V.m^{-3}.kg^{-2}.l^{4}
>
> silab <- function(..., units=NULL){ # creates a valid expression
> for xlab and co.
> dotCalls <- substitute(list(...))
> nArgs <- length(dotCalls)
> if (!is.null(units)) myUnits <- makeUnits(units)
> if (!is.null(units)) return(substitute(paste(..., " / ", myUnits)))
> if (is.null(units)) return(substitute(paste(...)))
> }
>
> silab("text", alpha, units = "V m^-3 kg^-2 l^4") # the result is
> obviously not what I want...