Skip to content

Problem when using subset.ffdf whithin a function #58

@carlosavellaneda8

Description

@carlosavellaneda8

Hi,

I am having some troubles trying to use subset whithin a function. I need a function that receives a string as an argument to make a subset, and it works fine when the object is a data frame but fails when the object is an ffdf. Here is a minimal example:

df <- mtcars
df_ffdf <- as.ffdf(df)

df_subset <- function(df, subset_string){
  subset(df, eval(parse(text = subset_string)))
}
tmp <- df_subset(df, 'mpg >= 20')
tmp2 <- df_subset(df_ffdf, 'mpg >= 20')

The error I get is object 'mpg' not found. I would appreciate any hints to solve this problem. Thanks in advance.

Best regards,
Carlos

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions