All of it is an expression (see ?expression). Maybe you'd better explain
what exactly you're trying to do or what you mean by standard format and
"usual way" (this part depends very much on what you're used to). You can
manipulate parts of this expression, say, like this:

foo <- expression(NA_character_, NA_character_, "Null Effect", "Pooled
effect",
   NA_character_, NA_character_, NA_character_, NA_character_,
   NA_character_, paste("Het Contours ", I^2, sep = ""), 0.4,
   0.41, 0.42, 0.45, NA_character_)

foo[[11]] <- 10000
foo[10] <- expression(cat("hello, ppl"))

# note that foo[[10]] is a call, so you can manipulate it like the usual
call objects are manipulated (i.e., the standard way :-). foo[10] is an
expression, so you can manipulate it in another standard way.

... and you can convert it to a character vector or a list

as.character(foo)
as.list(foo)

... and you can `eval` the whole expression e.g. using sapply or lapply.

sapply(foo, eval)
# umm ... maybe not, because you refer to I there which is probably in your
global
# environment, so try
sapply(foo, eval, envir=.GlobalEnv)

KK

On Mon, Aug 17, 2009 at 1:24 PM, deanj2k <dl...@le.ac.uk> wrote:

>
> Hello.
> I have a vector and within that vector is one expression.  When I display
> this vector it comes up as
>
> expression(NA_character_, NA_character_, "Null Effect", "Pooled effect",
>    NA_character_, NA_character_, NA_character_, NA_character_,
>    NA_character_, paste("Het Contours ", I^2, sep = ""), 0.4,
>    0.41, 0.42, 0.45, NA_character_)
>
> Where the part in bold is the element which is an expression.  How do I
> change this vector to a standard format what I can manipulate in the usual
> way?


> --
> View this message in context:
> http://www.nabble.com/help-with-expression%28%29-tp25004374p25004374.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help@r-project.org 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.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org 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