[R] looping through data frames in a workspace

2008-03-03 Thread lucy b
All, I have a workspace containing only data frame objects. I would like to loop though each one and clean-up text columns in them. How can I have R loop through the list? I have tried to find an answer in R help but the closest solution I can find is to make a static list of data frames, as illus

[R] looping through data frames in a workspace

2008-03-04 Thread lucy b
Thanks for helpful replies. Unfortunately, I didn't mention that I want to overwrite the existing data frame with the corrected one using the same name. Here's what I have: ## get names of data frames frames <- names(Filter(function(x) x=="data.frame", sapply(objects(),function(

[R] extracting data using strings as delimiters

2007-09-25 Thread lucy b
Dear List, I have an ascii text file with data I'd like to extract. Example: Year Built: 1873 Gross Building Area: 578 sq ft Total Rooms: 6 Living Area: 578 sq ft There is a lot of data I'd like to ignore in each record, so I'm hoping there is a way to use strings as delimiters to get the da

Re: [R] extracting data using strings as delimiters

2007-09-26 Thread lucy b
has same number of returned words > strapply(Lines, ": *(\\w+)", backref = -1, simplify = rbind) > > This matches a colon (:) followed by zero or more spaces ( *) > followed by a word ((\\w+)) and backref= - 1 causes it to return > only the first backreference (i..e. the portion