Re: [R] exact pattern match in grep for column headers
my question is exactly as described in this post http://tolstoy.newcastle.edu.au/R/e2/help/07/02/9812.html i am doing the pattern search using a vector 'vars[vi]' where i cannot use '^vars[vi]$' for a exact pattern match -- View this message in context: http://r.789695.n4.nabble.com/grep-tp3004422p3005885.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.
Re: [R] exact pattern match in grep for column headers
On Oct 21, 2010, at 12:17 PM, 1Rnwb wrote: my question is exactly as described in this post http://tolstoy.newcastle.edu.au/R/e2/help/07/02/9812.html You are citing a 3 year-old message that had multiple contributors. Either it wasn't answered by Dalgaard or your question is different. May I suggest that you use that message as a template for constructing a proper R-help question, i.e. one that has a cut-and-pastable input and specifies the desired output? i am doing the pattern search using a vector 'vars[vi]' where i cannot use '^vars[vi]$' for a exact pattern match -- View this message in context: http://r.789695.n4.nabble.com/grep-tp3004422p3005885.html Sent from the R help mailing list archive at Nabble.com. -- David Winsemius, MD West Hartford, CT __ 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.
Re: [R] exact pattern match in grep for column headers
Thanks I agree i did not asked the question correctly, but I solved the issue using the suggestions from this post. http://www.mail-archive.com/r-h...@stat.math.ethz.ch/msg23646.html -- View this message in context: http://r.789695.n4.nabble.com/grep-tp3004422p3006236.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.
Re: [R] exact pattern match in grep for column headers
the current code is like this vidx-grep(paste('^',vars[vi],'$',sep=''),gsub([[:punct:]],,strrl1[[datbeg-1]]),ignore.case=T) where as the old one was vidx-grep(vars[vi],gsub([[:punct:]],,strrl1[[datbeg-1]]),ignore.case=T) -- View this message in context: http://r.789695.n4.nabble.com/grep-tp3004422p3006240.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.