从fst文件中解析、检查和提取data.table对象

    描述

    一个用于将fst文件读取为data.table的api工具包,可以按列、行选择和条件筛选去选择

    Usage

    parse_fst(path)

    slice_fst(ft, row_no)

    select_fst(ft, …)

    filter_fst(ft, …)

    summary_fst(ft)

    Arguments


    path path to fst file
    ft An object of class fst_table, returned by parse_fst
    row_no An integer vector (Positive)
    The filter conditions
    1. library(tidyfst)
    2. fst::write_fst(iris,"iris_test.fst")
    3. # parse the file but not reading it
    4. parse_fst("iris_test.fst") -> ft
    5. ft
    6. class(ft)
    7. lapply(ft,class)
    8. names(ft)
    9. dim(ft)
    10. summary_fst(ft)
    11. # get the data by query
    12. ft %>% slice_fst(1:3)
    13. ft %>% slice_fst(c(1,3))
    14. ft %>% select_fst(Sepal.Length)
    15. ft %>% select_fst(Sepal.Length,Sepal.Width)
    16. ft %>% select_fst("Sepal.Length")
    17. ft %>% select_fst(1:3)
    18. ft %>% select_fst(1,3)
    19. ft %>% select_fst("Se")
    20. ft %>% select_fst("nothing")
    21. ft %>% select_fst("Se|Sp")
    22. ft %>% select_fst(cols = names(iris)[2:3])
    23. ft %>% filter_fst(Sepal.Width > 3)
    24. ft %>% filter_fst(Sepal.Length > 6 , Species == "virginica")
    25. ft %>% filter_fst(Sepal.Length > 6 & Species == "virginica" & Sepal.Width < 3)
    26. unlink("iris_test.fst")