Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8878033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:36:53+00:00 2026-06-14T19:36:53+00:00

I am performing a subset of a large ffdf objects and I noticed that

  • 0

I am performing a subset of a large ffdf objects and I noticed that when I use subset.ff it is generating a large number of NAs. I tried an alternative way by using ffwhich and the result is much faster and no NAs are generated. Here it is my test:

library(ffbase)
# deals is the ffdf I would like to subset
unique(deals$COMMODITY)
ff (open) integer length=7 (7) levels: CASH CO2 COAL ELEC GAS GCERT OIL
  [1]   [2]   [3]   [4]   [5]   [6]   [7] 
CASH  CO2   COAL  ELEC  GAS   GCERT OIL   

# Using subset.ff
started.at=proc.time()
deals0 <- subset.ff(deals,deals$COMMODITY %in% c("CASH","COAL","CO2","ELEC","GCERT"))
cat("Finished in",timetaken(started.at),"\n")
Finished in 12.640sec
# NAs are generated
unique(deals0$COMMODITY)
ff (open) integer length=8 (8) levels: CASH CO2 COAL ELEC GAS GCERT OIL <NA>
  [1]   [2]   [3]   [4]   [5]   [6]   [7]   [8] 
CASH  CO2   COAL  ELEC  GAS   GCERT OIL   NA    

# Subset using ffwhich
started.at=proc.time()
idx <- ffwhich(deals,COMMODITY %in% c("CASH","COAL","CO2","ELEC","GCERT"))
deals1 <- deals[idx,]
cat("Finished in",timetaken(started.at),"\n")
Finished in 3.130sec
# No NAs are generated
unique(deals1$COMMODITY)
ff (open) integer length=7 (7) levels: CASH CO2 COAL ELEC GAS GCERT OIL
  [1]   [2]   [3]   [4]   [5]   [6]   [7] 
CASH  CO2   COAL  ELEC  GAS   GCERT OIL   

Any idea why this is happening?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T19:36:55+00:00Added an answer on June 14, 2026 at 7:36 pm

    subset.ff is probably using [and your criterion but not including a !is.na(.) clause. The default for “[” is to return items that are either TRUE or NA for the criterion vector. The regular subset function adds a !is.na(.) clause, but maybe the authors of ffbase didn’t get around to that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After performing some tests I noticed that printf is much faster than cout .
Performing user authentication in Java EE / JSF using j_security_check I tried this solution.
During performing some performance tuning in my application I have noticed, that hibernate query
Occasionally when performing a rebase using the MercurialEclipse plugin my repository gets thrown into
Im talking about performing a deep recursion for around 5+ mins, something that you
I'm performing a simulation of a simple queue using SimPy . One of the
I have a problem that I would like to solve using Django's ORM. I
When performing UPDATE and INSERT queries using Zend_Db, I frequently need to set values
When performing OO design, is it better to consolidate a collection of methods that
While performing code review, I found code that could cut down on potential bugs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.