Skip to content
Prev 304690 / 398506 Next

splits with 0s in middle columns

Hello,

You don't need a new function, what you need is to prepare your data in 
such a way that the function can process it.


A <- c("percent (10/20/30)", "percent (40/20)", "percent (60/10/10/5)",
"percent (80/10)")
B <- gsub("\\(|\\)|percent| ", "", A)
fun(B)

Also, please use dput to post the data examples,

dput(A)
c("percent (10/20/30)", "percent (40/20)", "percent (60/10/10/5)",
"percent (80/10)")

Then copy&paste in your post.

Rui Barradas

Em 02-09-2012 04:22, Sapana Lohani escreveu: