exemplo <- c("Rua Pajé, 30, apto 44", "Av. Brasil,55, blocoB") gsub("^([^,]+,[^,]+),.*$", "\\1", exemplo)
Standard input is empty
[1] "Rua Pajé, 30" "Av. Brasil,55"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!