Displaying 1 result from an estimated 1 matches for "dfin".
Did you mean:
_fin
2009 Oct 21
0
"eliminate" characters of one data.frame col, using another column
...the code below. But it's slow for big files
(which I have) and most likely there's a better way to do this
1) is there a function that would do the same as FUN.remove2ndCol
2) is there a way to avoid the "apply" for every row?
Thanks,
Tiago
###################################
dfIn <- data.frame(a=c('ffff', 'hhhh', 'jjjj'), b=c('f', 'j', 'g'),
c=c('f', 'h', 'g'))
FUN.remove2ndCol <- function(vec){
vec.sub <- sub(vec['b'], '', vec['a'])
vec.sub <- sub(vec['c'...