2: Factor w/ 2 levels "B1","B2": 1 2 1 2 1 2
# $ name1 : chr "A11" "A11" "A22" "A22" ...
# $ name2 : chr "B11" "B22" "B11" "B22" ...
A.K.
- Original Message -
From: Fg Nu
To: "r
I want to change the type to factor of all variables in a data frame whose
names match a certain pattern.
So here I am trying to change the type to factor of all variables whose name
begins with namestub in the dataframe df.
attach(df)sapply(grep(glob2rx("namestub*"),names(df)),as.factor)
But thi
On Mon, 15 Oct 2007, jim holtman wrote:
> for (i in list.files(pattern=".*\\.R$")) source(i)
Using Sys.glob() is perhaps more natural for most users:
for(file in Sys.glob("*.R")) source(file)
It is referenced from ?list.files these days.
> On 10/15/07, subura <[EMAIL PROTECTED]> wrote:
>>
>>
subura said the following on 10/15/2007 12:04 PM:
> Care to explain how i can use a wildcard expression to "source" all files
> ending with .R in a subdirectory ? I've tried something like this
> 'source(glob2rx("*.R"))' without success.
>
> Thank you
Try
R.files <- list.files(my.path, pattern
for (i in list.files(pattern=".*\\.R$")) source(i)
On 10/15/07, subura <[EMAIL PROTECTED]> wrote:
>
> Care to explain how i can use a wildcard expression to "source" all files
> ending with .R in a subdirectory ? I've tried something like this
> 'source(glob2rx("*.R"))' without success.
>
> Thank
Care to explain how i can use a wildcard expression to "source" all files
ending with .R in a subdirectory ? I've tried something like this
'source(glob2rx("*.R"))' without success.
Thank you
--
View this message in context:
http://www.nabble.com/Wildcards-tf4627981.html#a13214214
Sent from the
6 matches
Mail list logo