Skip to content
Back to formatted view

Raw Message

Message-ID: <OF226F0820.022A4C5A-ON802573B0.0053EA2B-802573B0.0054366D@hsl.gov.uk>
Date: 2007-12-13T15:19:56Z
From: Richard Cotton
Subject: ls() pattern
In-Reply-To: <14316765.post@hsl.gov.uk>

> I get some data in the following format and I would like to combine them 
to
> form a dataframe. 
>
> The data is like:
> 
> cbcname1 = 0.1,
> cbcname2= 0.2,
> cbcname3=0.3,...
> 
> name1, name2, name2 are just some random names. I would like to achieve 
sth
> like:
> (cbcname1=0.1, cbcname2=0.2, cbcname3=0.3,......)
> 
> I am using the following codes
> do.call(cbind, ls(pat=paste("cbc",*,"=")))

Try this:

unlist(mget(ls(pattern="cbc"), envir=.GlobalEnv))

The output is an array rather than a data frame, but so would be the 
output from cbind.

Regards,
Richie.

Mathematical Sciences Unit
HSL


------------------------------------------------------------------------
ATTENTION:

This message contains privileged and confidential inform...{{dropped:20}}