error length > 1 and only the first element will be used? I'm new i data mining and R, and i'm working with a dataset and trying to remove the "white space" elements. i tried to create a function to do that.

elim.fal=function(v){
contador=0
for (i in length(v)){
if (as.factor(v[i])== "" &amp;&amp; contador&lt;=length(v)){
  a=v[-i]
}
else {
  a=v

}
contador= contador+1
return(a)
}


but appear that error
I can't reproduce that error message, so I'm not sure what's going wrong.  That said, the typical way to filter a vector in R is to subset it with a conditional like so:

tst&lt;-c("","foo", "bar", "", "baz")
tst[tst!=""]
[1] "foo" "bar" "baz"