0

I want to extract the number of 1000 values from large size of ff object in R.

I have tried sample_frac from dplyr package, but this results in error as below;

Error: tbl must be a data frame, not a ffdf object

How can I solve this problem?

imtaiky
  • 191
  • 1
  • 12

1 Answers1

0

You can use ffbase2 package. It adds the dplyr interface to ff object

install.packages("devtools")
devtools::install_github("edwindj/ffbase2")

And read ff object as tbl with tbl_ffdf function.

iris_f <- tbl_ffdf(iris)

species <- 
   iris_f %>%
   group_by(Species) %>%
   summarise(petal_width = sum(Petal.Width))
ghosh'.
  • 1,567
  • 1
  • 14
  • 19
  • When I used devtools::install_github("edwindj/ffbase2"), I came across the error as below; package ‘backports’ successfully unpacked and MD5 sums checked Error: (converted from warning) cannot remove prior installation of package ‘backports’ In addition: Warning messages: 1: In untar2(tarfile, files, list, exdir) : skipping pax global extended headers 2: In untar2(tarfile, files, list, exdir) : skipping pax global extended headers 3: In is.na(remote_deps$package) : is.na() applied to non-(list or vector) of type 'NULL' What should I do with this? – imtaiky Jun 12 '19 at 12:26
  • Hi, it worked by re-installing backports! Thank you very much for your help. – imtaiky Jun 12 '19 at 13:31