Robin Hankin wrote:
> Hi
>
> If
>
> string <- "xyz"
> f <- function(x){1 + sin(cos(x)) + exp(x^2)}
>
> How do I manipulate "string" and f() to give the string
>
> "1 + sin(cos(xyz)) + exp(xyz^2)"
>
> ?
>   
Hi,

Here what i'll do :

f <- function(x){
  sprintf("1 + sin(cos(%s)) + exp(%s^2)", x, x)
}

Cheers,

Romai


> --
> Robin Hankin
> Uncertainty Analyst
> National Oceanography Centre, Southampton
> European Way, Southampton SO14 3ZH, UK
>   tel  023-8059-7743
>
> ______________________________________________
> [email protected] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to