无法在 multidplyr 中调用 create_cluster

Unable to call create_cluster in multidplyr

我能够加载所有包并能够看到可用内核的数量,但我得到了
create_cluster(4) 中的错误:找不到函数“create_cluster”

    library(multidplyr)
    library(dplyr)
    library(parallel)
    numCores <- detectCores()
    start.time <- Sys.time() 
    cluster <- create_cluster(4)

因为您可以使用 lsf.str() 查看包中提供的所有函数,所以您会看到函数 create_cluster() 未包含在内。 运行:

ls("package:multidplyr")
ls("package:dplyr")
ls("package:parallel")

为您提供所有功能的列表。乘数:

 [1] "%>%"                      "cluster_assign"          
 [3] "cluster_assign_each"      "cluster_assign_partition"
 [5] "cluster_call"             "cluster_copy"            
 [7] "cluster_library"          "cluster_rm"              
 [9] "cluster_send"             "default_cluster"         
[11] "new_cluster"              "partition"               
[13] "party_df"                

dplyr:

  [1] "%>%"                   "across"                "add_count"            
  [4] "add_count_"            "add_row"               "add_rownames"         
  [7] "add_tally"             "add_tally_"            "all_equal"            
 [10] "all_of"                "all_vars"              "anti_join"            
 [13] "any_of"                "any_vars"              "arrange"              
 [16] "arrange_"              "arrange_all"           "arrange_at"           
 [19] "arrange_if"            "as.tbl"                "as_data_frame"        
 [22] "as_label"              "as_tibble"             "auto_copy"            
 [25] "band_instruments"      "band_instruments2"     "band_members"         
 [28] "bench_tbls"            "between"               "bind_cols"            
 [31] "bind_rows"             "c_across"              "case_when"            
 [34] "changes"               "check_dbplyr"          "coalesce"             
 [37] "collapse"              "collect"               "combine"              
 [40] "common_by"             "compare_tbls"          "compare_tbls2"        
 [43] "compute"               "contains"              "copy_to"              
 [46] "count"                 "count_"                "cumall"               
 [49] "cumany"                "cume_dist"             "cummean"              
 [52] "cur_column"            "cur_data"              "cur_data_all"         
 [55] "cur_group"             "cur_group_id"          "cur_group_rows"       
 [58] "current_vars"          "data_frame"            "data_frame_"          
 [61] "db_analyze"            "db_begin"              "db_commit"            
 [64] "db_create_index"       "db_create_indexes"     "db_create_table"      
 [67] "db_data_type"          "db_desc"               "db_drop_table"        
 [70] "db_explain"            "db_has_table"          "db_insert_into"       
 [73] "db_list_tables"        "db_query_fields"       "db_query_rows"        
 [76] "db_rollback"           "db_save_query"         "db_write_table"       
 [79] "dense_rank"            "desc"                  "dim_desc"             
 [82] "distinct"              "distinct_"             "distinct_all"         
 [85] "distinct_at"           "distinct_if"           "distinct_prepare"     
 [88] "do"                    "do_"                   "dplyr_col_modify"     
 [91] "dplyr_reconstruct"     "dplyr_row_slice"       "ends_with"            
 [94] "enexpr"                "enexprs"               "enquo"                
 [97] "enquos"                "ensym"                 "ensyms"               
[100] "eval_tbls"             "eval_tbls2"            "everything"           
[103] "explain"               "expr"                  "failwith"             
[106] "filter"                "filter_"               "filter_all"           
[109] "filter_at"             "filter_if"             "first"                
[112] "frame_data"            "full_join"             "funs"                 
[115] "funs_"                 "glimpse"               "group_by"             
[118] "group_by_"             "group_by_all"          "group_by_at"          
[121] "group_by_drop_default" "group_by_if"           "group_by_prepare"     
[124] "group_cols"            "group_data"            "group_indices"        
[127] "group_indices_"        "group_keys"            "group_map"            
[130] "group_modify"          "group_nest"            "group_rows"           
[133] "group_size"            "group_split"           "group_trim"           
[136] "group_vars"            "group_walk"            "grouped_df"           
[139] "groups"                "id"                    "ident"                
[142] "if_all"                "if_any"                "if_else"              
[145] "inner_join"            "intersect"             "is.grouped_df"        
[148] "is.src"                "is.tbl"                "is_grouped_df"        
[151] "lag"                   "last"                  "last_col"             
[154] "lead"                  "left_join"             "location"             
[157] "lst"                   "lst_"                  "make_tbl"             
[160] "matches"               "min_rank"              "mutate"               
[163] "mutate_"               "mutate_all"            "mutate_at"            
[166] "mutate_each"           "mutate_each_"          "mutate_if"            
[169] "n"                     "n_distinct"            "n_groups"             
[172] "na_if"                 "near"                  "nest_by"              
[175] "nest_join"             "new_grouped_df"        "nth"                  
[178] "ntile"                 "num_range"             "one_of"               
[181] "order_by"              "percent_rank"          "progress_estimated"   
[184] "pull"                  "quo"                   "quo_name"             
[187] "quos"                  "recode"                "recode_factor"        
[190] "relocate"              "rename"                "rename_"              
[193] "rename_all"            "rename_at"             "rename_if"            
[196] "rename_vars"           "rename_vars_"          "rename_with"          
[199] "right_join"            "row_number"            "rows_delete"          
[202] "rows_insert"           "rows_patch"            "rows_update"          
[205] "rows_upsert"           "rowwise"               "same_src"             
[208] "sample_frac"           "sample_n"              "select"               
[211] "select_"               "select_all"            "select_at"            
[214] "select_if"             "select_var"            "select_vars"          
[217] "select_vars_"          "semi_join"             "setdiff"              
[220] "setequal"              "show_query"            "slice"                
[223] "slice_"                "slice_head"            "slice_max"            
[226] "slice_min"             "slice_sample"          "slice_tail"           
[229] "sql"                   "sql_escape_ident"      "sql_escape_string"    
[232] "sql_join"              "sql_select"            "sql_semi_join"        
[235] "sql_set_op"            "sql_subquery"          "sql_translate_env"    
[238] "src"                   "src_df"                "src_local"            
[241] "src_mysql"             "src_postgres"          "src_sqlite"           
[244] "src_tbls"              "starts_with"           "starwars"             
[247] "storms"                "summarise"             "summarise_"           
[250] "summarise_all"         "summarise_at"          "summarise_each"       
[253] "summarise_each_"       "summarise_if"          "summarize"            
[256] "summarize_"            "summarize_all"         "summarize_at"         
[259] "summarize_each"        "summarize_each_"       "summarize_if"         
[262] "sym"                   "syms"                  "tally"                
[265] "tally_"                "tbl"                   "tbl_df"               
[268] "tbl_nongroup_vars"     "tbl_ptype"             "tbl_sum"              
[271] "tbl_vars"              "tibble"                "top_frac"             
[274] "top_n"                 "transmute"             "transmute_"           
[277] "transmute_all"         "transmute_at"          "transmute_if"         
[280] "tribble"               "trunc_mat"             "type_sum"             
[283] "ungroup"               "union"                 "union_all"            
[286] "validate_grouped_df"   "vars"                  "with_groups"          
[289] "with_order"            "wrap_dbplyr_obj"    

并行:

 [1] "clusterApply"        "clusterApplyLB"      "clusterCall"        
 [4] "clusterEvalQ"        "clusterExport"       "clusterMap"         
 [7] "clusterSetRNGStream" "clusterSplit"        "detectCores"        
[10] "getDefaultCluster"   "makeCluster"         "makeForkCluster"    
[13] "makePSOCKcluster"    "mclapply"            "mcMap"              
[16] "mcmapply"            "nextRNGStream"       "nextRNGSubStream"   
[19] "parApply"            "parCapply"           "parLapply"          
[22] "parLapplyLB"         "parRapply"           "parSapply"          
[25] "parSapplyLB"         "pvec"                "setDefaultCluster"  
[28] "splitIndices"        "stopCluster"       

这些信息对您有帮助吗?