Skip to content
Prev 306705 / 398506 Next

ffbase, help with %in%

Hi Lucas

I don't know the ff package very well but here is what I found. Maybe
there is a clue in here
[1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE

#but
[1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
# and also
[1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE

That seems to be because an ff object is a list
list()
 - attr(*, "physical")=Class 'ff_pointer' <externalptr>
  ..- attr(*, "vmode")= chr "double"
  ..- attr(*, "maxlength")= int 10
  ..- attr(*, "pattern")= chr "clone"
  ..- attr(*, "filename")= chr
"/private/var/folders/ub/ubvWLUkKHf8WAywv5rmtcE+++TI/-Tmp-/RtmpmMKHRx/clone406828b135cc.ff"
  ..- attr(*, "pagesize")= int 65536
  ..- attr(*, "finalizer")= chr "close"
  ..- attr(*, "finonexit")= logi TRUE
  ..- attr(*, "readonly")= logi FALSE
  ..- attr(*, "caching")= chr "mmnoflush"
 - attr(*, "virtual")= list()
  ..- attr(*, "Length")= int 10
  ..- attr(*, "Symmetric")= logi FALSE
  ..- attr(*, "ramclass")= chr "Date"
 - attr(*, "class") =  chr [1:2] "ff_vector" "ff"

If you make a data frame e.g
df <- data.frame(date=z,letter=letters[1:10])
# this doesn't work
logical(0)
# but this does
ff (open) logical length=10 (10)
 [1]  [2]  [3]  [4]  [5]  [6]  [7]  [8]  [9] [10]
TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE

The question is: In your example, do you want "a" to be a ff object or
the first column of data to be an ff object (I could get this to work
- propably for the reasons above :
Error in as.data.frame.default(x[[i]], optional = TRUE,
stringsAsFactors = stringsAsFactors) :
  cannot coerce class 'c("ff_vector", "ff")' into a data.frame
On 1 October 2012 20:07, Lucas Chaparro <lpchaparrovio at gmail.com> wrote: