[R] suggestion of regex pattern

Boris Steipe boris.steipe at utoronto.ca
Sat Apr 18 16:04:39 CEST 2015


This is not a regular expression but simply a conjunction (sequence of '&') of logical expressions. Moreover it's not wrong. Consider:

xyz <- data.frame(municipio = c('Limeira'), mesincident = c('marco'), trechoklmetros = c(3.00, -4.00, 30))
xyz

  municipio mesincident trechoklmetros
1   Limeira       marco              3
2   Limeira       marco             -4
3   Limeira       marco             30


xyz$municipio =='Limeira' & xyz$mesincident =='marco' & xyz$trechoklmetros > 1.00
[1]  TRUE FALSE  TRUE

xyz$municipio =='Limeira' & xyz$mesincident =='marco' & xyz$trechoklmetros > 1.00 & xyz$trechoklmetros <= 12.3
[1]  TRUE FALSE FALSE


If there's a problem it seems to be elsewhere.
Cheers,
Boris


On Apr 17, 2015, at 4:22 PM, Fernando Gama <f.fabiogama88 at gmail.com> wrote:

> Hello,
> 
> I have benn problems to construct the pattern for this:
> 
> municipio =='Limeira' & mesincident =='marco' & trechoklmetros > 1.00 12.300
> 
> I would like:
> 
> municipio =='Limeira' & mesincident =='marco' & trechoklmetros > 1.00
> *& **trechoklmetros
> <= *12.300
>> ​Any suggestion?​
> 
> 
> -- 
> Att,
> 
> Fernando Gama da Mata
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.



More information about the R-help mailing list