[R] File selection by condition

Svempa fempa at yahoo.com
Mon Oct 1 11:57:28 CEST 2007


Thank you, though one small problem remains. How do I define the criteria so
that it searches through every value in the matrices? As for now it only
looks at the first [1,1] value of the matrices.




jholtman wrote:
> 
> Read the files in, select those that meet the criteria and store them in a
> list
> 
> match.list <- list()
> for (i in list.files(pattern="some pattern")){
>     x.in <- read.table(i)
>     if (your match criteria) match.list[[i]] <- x.in
> }
> 
> On 9/28/07, Svempa <fempa at yahoo.com> wrote:
>>
>> I have a large number of textfiles, and one matix in every texfile. I now
>> want to find an easy way to select those textfiles that contain at least
>> one
>> value over a certain limit, and collect those matrices in a vector or
>> something alike. How do I do that?
>>
>> --
>> View this message in context:
>> http://www.nabble.com/File-selection-by-condition-tf4534428.html#a12940278
>> Sent from the R help mailing list archive at Nabble.com.
>>
>> ______________________________________________
>> R-help at 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.
>>
> 
> 
> -- 
> Jim Holtman
> Cincinnati, OH
> +1 513 646 9390
> 
> What is the problem you are trying to solve?
> 
> ______________________________________________
> R-help at 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.
> 
> 

-- 
View this message in context: http://www.nabble.com/File-selection-by-condition-tf4534428.html#a12976300
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list